Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/nicoaudy/ignoreable-observers
- Owner: nicoaudy
- License: mit
- Created: 2018-11-19T04:26:40.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-19T04:33:31.000Z (about 6 years ago)
- Last Synced: 2024-12-17T08:11:10.896Z (about 1 month ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.