Example #1
0
 /**
  * The "booting" method of the model.
  *
  * @return void
  */
 public static function boot()
 {
     parent::boot();
     File::creating(function ($file) {
         if (!$file->path) {
             throw new \Exception('File model must contain a not-null path attribute');
         }
     });
 }