/** * Deletes photos * * @return mixed */ public function delete() { $imageUrl = $this->image; if (unlink($imageUrl)) { return parent::delete(); } }
public static function boot() { parent::boot(); static::deleting(function ($item) { dd('Deleting event handler executed on item #' . $item->id); }); }
/** * Deletes customers * * @return mixed */ public function delete() { foreach ($this->photos()->get() as $photo) { $photo->delete(); } return parent::delete(); }
/** * This method will set model values * * @param array $attributes */ public function fill(array $attributes) { parent::fill($attributes); if (!empty($attributes)) { if ($this->id == NULL) { // ok this is new member, so we need password for it $this->password = \Hash::make($attributes['passwd']); } else { // updating admin if (!empty($attributes['changePassword']) && $attributes['changePassword'] == 1) { $this->password = \Hash::make($attributes['passwd']); } } } }
public function getDates() { return array_merge(parent::getDates(), ['date']); }
public function getDates() { return array_merge(parent::getDates(), ['training_resource_entryDate', 'training_resource_last_update']); }
public function getDates() { return array_merge(parent::getDates(), ['valido_hasta']); }
public function getDates() { return array_merge(parent::getDates(), ['birthday']); }
/** * Creates a new instance of the model. * * @param array $attributes */ public function __construct(array $attributes = array()) { parent::__construct($attributes); $this->table = Config::get('entrust.roles_table'); }
public function save(array $options = array()) { $this->alias = $this->alias ? str_slug($this->alias) : str_slug($this->name); $saved = parent::save($options); return $saved; }