Example #1
0
 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         $model->beforeCreate();
     });
 }
Example #2
0
 public static function boot()
 {
     parent::boot();
     static::saving(function ($instance) {
         $instance->beforeSave();
     });
 }
Example #3
0
 public static function boot()
 {
     parent::boot();
     static::creating(function ($instance) {
         $instance->beforeCreate();
     });
     static::created(function ($instance) {
         $instance->afterCreate();
     });
 }