akaunting/laravel-mutable-observer

Mutable observer package for Laravel

2.0.1 2023-03-16 14:49 UTC

This package is auto-updated.

Last update: 2024-11-16 18:38:50 UTC


README

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.