Observer class may be called as a type of Listener class, listening to the events of changes on particular Eloquent Model.
With the command php artisan make:observer --model=ModelName you can create an Observer class that would automatically listen to ModelName (like, "User") events like created(), updated(), etc.
A typical example is updating related records in other DB tables after some change happened in the main related table.
Read more in the official Laravel docs.
With the command php artisan make:observer --model=ModelName you can create an Observer class that would automatically listen to ModelName (like, "User") events like created(), updated(), etc.
A typical example is updating related records in other DB tables after some change happened in the main related table.
Read more in the official Laravel docs.