Example #1
0
 /**
  * Boot Method
  */
 public static function boot()
 {
     parent::boot();
     // self::created(function(){
     //     Cache::tags('ReportEager')->flush();
     // });
     // self::updated(function(){
     //     Cache::tags('ReportEager')->flush();
     // });
     // self::deleted(function(){
     //     Cache::tags('ReportEager')->flush();
     // });
 }
Example #2
0
 /**
  * Boot Method
  */
 public static function boot()
 {
     parent::boot();
     self::creating(function ($data) {
         $data->user_id = Auth::user()->id;
     });
     // self::created(function () {
     //     Cache::tags('Upload')->flush();
     // });
     // self::updated(function () {
     //     Cache::tags('Upload')->flush();
     // });
     // self::deleted(function () {
     //     Cache::tags('Upload')->flush();
     // });
     self::deleting(function ($data) {
         File::deleteDirectory($data->path);
         return true;
     });
 }