Ответ 1
Внутри вашей модели вы можете добавить метод boot(), который позволит вам управлять этими событиями.
Например, имея модель User.php:
class User extends Model
{
public static function boot()
{
parent::boot();
self::creating(function($model){
// ... code here
});
self::created(function($model){
// ... code here
});
self::updating(function($model){
// ... code here
});
self::updated(function($model){
// ... code here
});
self::deleting(function($model){
// ... code here
});
self::deleted(function($model){
// ... code here
});
}
}
Здесь вы можете просмотреть все доступные события: https://laravel.com/docs/5.2/eloquent#events