Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nicoaudy/ignoreable-observers

Ignoring laravel event, tricky if you guys using observer.
https://github.com/nicoaudy/ignoreable-observers

Last synced: about 6 hours ago
JSON representation

Ignoring laravel event, tricky if you guys using observer.

Awesome Lists containing this project

README

        

# Ignorable Observers

Dynamically disable/enable Laravel's Eloquent model observers. This library provides the ability to temporarily disable observable events for Eloquent models. For example, temporarily disable observers that kick off emails, push notifications, or queued calculations when performing a large number of database inserts or updates.

## Installation

Install using composer:

```
composer require nicoaudy/ignoreable-observers
```

## Usage

To give an Eloquent model the ability to temporarily ignore observers, simply add the `IgnorableObservers` trait:

```php
$i
]);
}

ExampleModel::unignoreObservableEvents();
```

## License

Ignorable Observers is an open-sourced library licensed under the MIT license.