I need to generate a function to call after or before save() or update() but i don\'t know how to do. I think I need a callback from save() update() but I don\'t know how to
Create a provider by using this command
php artisan make:provider ProviderClassName
then define the callbacks for models in boot function
Model::created(function($model){
//Do you want to do
});
List of available callbacks:
Model::creating(function($model){});
Model::updated(function($model){});
Model::updating(function($model){});
Model::deleted(function($model){});
Model::deleting(function($model){});
Model::saving(function($model){});
Model::saved(function($model){});