rdehnhardt/model-observers is a Laravel package for make model observers easy.
It currently has 16 GitHub stars and 14 downloads on Packagist (latest version 1.0.2).
Install it with composer require rdehnhardt/model-observers.
Discover more Laravel packages by rdehnhardt
or browse all Laravel packages to compare alternatives.
Last updated
Set observer for model
Run the following command to get the latest version package
composer require rdehnhardt/model-observer
// app/Customer.php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Rdehnhardt\ModelObserver\ModelObserver;
class Customer extends Model
{
use ModelObserver;
/**
* Models Observer
*
* @var string
*/
protected static $observer = UserObserver::class;
}
Contributions are welcomed; to keep things organized, all bugs and requests should be opened on github issues tab for the main project in the rdehnhardt/model-observer/issues.
All pull requests should be made to the branch Develop, so they can be tested before being merged into the master branch.
If you are having problems with the use of this package, there is likely someone has faced the same problem. You can find common answers to their problems:
The model-observer package is open source software licensed under the license MIT