This package allows you to mute
and unmute
a specific observer at will. It ships with a trait that adds mutable methods to your observer.
Run the following command:
composer require akaunting/laravel-mutable-observer
All you have to do is use the Mutable
trait inside your observer.
namespace App\Observers;
use Akaunting\MutableObserver\Traits\Mutable;
class UserObserver
{
use Mutable;
}
Now you can mute
and unmute
the observer as needed:
UserObserver::mute();
// Some logic, i.e. test
UserObserver::unmute();
Please see Releases for more information what has changed recently.
Pull requests are more than welcome. You must follow the PSR coding standards.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see LICENSE for more information.