Download the PHP package binary-cats/fireable-attribute-events without Composer
On this page you can find all versions of the php package binary-cats/fireable-attribute-events. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download binary-cats/fireable-attribute-events
More information about binary-cats/fireable-attribute-events
Files in binary-cats/fireable-attribute-events
Package fireable-attribute-events
Short Description Observe and trigger events based on attributes changes
License MIT
Homepage https://github.com/binary-cats
Informations about the package fireable-attribute-events
Fireable Attribute Events
Observe and trigger events based on Eloquent model attributes changes
Installation
You can install the package via Composer:
Usage
Add the FireableAttributes
Trait to Your Model:
In any Eloquent model where you want to fire events on attribute changes,
use the FireableAttributes
trait and define a fireableAttributes
array:
- Direct mapping: If status changes, it fires OrderStatusChanged.
- Value-based mapping: If priority changes to 'high', it fires OrderMarkedHighPriority; if 'urgent', it fires OrderMarkedUrgent.
Each event should accept the model as a constructor parameter.
Events Fire Automatically When Attributes Change.
Once a model using FireableAttributes
is updated, the package will automatically dispatch the corresponding event:
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using issue tracker.
Postcardware
You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Credits
- Cyrill Kalita
- All Contributors
Support us
Binary Cats is a webdesign agency based in Illinois, US.
License
The MIT License (MIT). Please see License File for more information.
All versions of fireable-attribute-events with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0|^12.0