akaunting/laravel-mutable-observer

Mutable observer package for Laravel

1.0.0 2022-02-23 08:45 UTC

This package is auto-updated.

Last update: 2022-09-23 10:04:38 UTC


README

Downloads Tests StyleCI Quality 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.