/** * Create a new AdministratorModel instance. */ public function __construct(array $attributes = array()) { parent::__construct($attributes); if (!static::$app) { static::$app = app(); } $this->table = 'cb_administrators'; }
public function delete() { if ($this->id === $this->currentUser()->id) { return false; } $id = $this->id; Activity::log(array('contentID' => $this->id, 'contentType' => 'account_deleted', 'description' => $this->id, 'details' => '', 'updated' => $this->currentUser()->id ? true : false)); Event::fire('controller.user.delete', array($this)); if (!parent::delete()) { return false; } return !$this->find($id) ? true : false; }
public function setUp() { ConfideUser::$app = $this->mockApp(); $this->confide_user = new ConfideUser(); }
public function afterSave($success = true, $forced = false) { if ($this->email) { return parent::afterSave($success = true, $forced = false); } else { return true; } }
public function __construct(array $attributes = array()) { $this->hasAttachedFile('avatar', ['styles' => ['medium' => '300x300', 'thumb' => '100x100'], 'default_url' => 'missing.png']); parent::__construct($attributes); }
public function delete() { return parent::delete(); }
/** * Boot */ public static function boot() { parent::boot(); // self::created(function () { // Cache::tags('User')->flush(); // }); // self::updated(function () { // Cache::tags('User')->flush(); // }); // self::deleted(function () { // Cache::tags('User')->flush(); // }); }