Skip to content

akaunting/laravel-mutable-observer

Repository files navigation

Mutable observer package for Laravel

Downloads Tests StyleCI License

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.

Installation

Run the following command:

composer require akaunting/laravel-mutable-observer

Usage

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();

Changelog

Please see Releases for more information what has changed recently.

Contributing

Pull requests are more than welcome. You must follow the PSR coding standards.

Security

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see LICENSE for more information.