Download the PHP package envant/fireable without Composer
On this page you can find all versions of the php package envant/fireable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download envant/fireable
More information about envant/fireable
Files in envant/fireable
Package fireable
Short Description An elegant way to trigger events based on attributes changes
License MIT
Homepage https://github.com/envant/fireable
Informations about the package fireable
Fireable
An elegant way to trigger events based on attributes changes.
Installation
Install package through Composer
Usage
- Add the
FireableAttributes
trait to your model - Define the attributes with specified events via the
protected $fireableAttributes
property on the model
Example
Let's say we need to trigger specified events when specific model attributes are updated.
For example, you need to notify user when he gets an "approved" status. Instead of observing model's "dirty" attributes and firing events manually we could do it more elegantly by assigning specified events to attributes or even certain values of attributes.
Also you may not need to track certain values, so you can assign an event directly to an attribute itself. So, in the example below, each time the user's email is changed, the appropriate event will be fired.
Change log
Please see the changelog for more information on what has changed recently.
Testing
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
- Boris Lepikhin
- All Contributors
License
license. Please see the license file for more information.
All versions of fireable with dependencies
illuminate/support Version ^5.8|^6|^7|^8|^9|^10.0
illuminate/database Version ^5.8|^6|^7|^8|^9|^10.0