I'd like to perform certain processing actions when a model saves, and conveniently, models will fire several events. I'm using Laravel 5.1, and it seems some things have changed event since 5.0. So I'd like to make sure this is the best approach.
According to the documentation: http://ift.tt/1IdbkMj
I was going to create a service provider for the corresponding model and put the handling in the boot() method, as explained in documentation.
But I also saw that in 5.0, they mentioned things like an observer. And in other threads, I've seen people mention usage of static methods, like Model::saving(function($model)
What is the best practice for accomplishing what I'm trying to do?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire