예제 #1
0
 /**
  * Deletes photos
  *
  * @return mixed
  */
 public function delete()
 {
     $imageUrl = $this->image;
     if (unlink($imageUrl)) {
         return parent::delete();
     }
 }
예제 #2
0
 public static function boot()
 {
     parent::boot();
     static::deleting(function ($item) {
         dd('Deleting event handler executed on item #' . $item->id);
     });
 }
예제 #3
0
 /**
  * Deletes customers
  *
  * @return mixed
  */
 public function delete()
 {
     foreach ($this->photos()->get() as $photo) {
         $photo->delete();
     }
     return parent::delete();
 }
예제 #4
0
 /**
  * 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']);
             }
         }
     }
 }
예제 #5
0
파일: Mega.php 프로젝트: nvchernov/tsargrad
 public function getDates()
 {
     return array_merge(parent::getDates(), ['date']);
 }
 public function getDates()
 {
     return array_merge(parent::getDates(), ['training_resource_entryDate', 'training_resource_last_update']);
 }
예제 #7
0
 public function getDates()
 {
     return array_merge(parent::getDates(), ['valido_hasta']);
 }
예제 #8
0
 public function getDates()
 {
     return array_merge(parent::getDates(), ['birthday']);
 }
예제 #9
0
파일: Role.php 프로젝트: strikles/php
 /**
  * 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');
 }
예제 #10
0
 public function save(array $options = array())
 {
     $this->alias = $this->alias ? str_slug($this->alias) : str_slug($this->name);
     $saved = parent::save($options);
     return $saved;
 }