envant / fireable Goto Github PK
View Code? Open in Web Editor NEWAn elegant way to trigger Laravel events based on attributes changes.
License: MIT License
An elegant way to trigger Laravel events based on attributes changes.
License: MIT License
The ServiceProvider publishes a config file but there is no config file in your project.
Current state works good for statuses, what about numeric/dynamic fields?
I want to dispatch an event when a user passing 50 points.
class User extends Model
{
use FireableAttributes;
protected $fillable = [
'points',
];
protected function getFireableAttributes() : array
{
return [
'points' => [
UserPassed50Points::class => static function (User $user) {
return $user->points >= 50;
},
],
];
}
}
The implementation is a bit problematic, because it requires to use a method and not a property, as well it's moving the event name to the key and the closure to the value.
We want to upgrade to Laravel 9 but this package has no release (yet) to support it. I see in that you commit the changes already in the master-branch, but I don't see a new release.
When is the new release planned?
Hey!
I would like to use this with a Laravel 10 app. Is it possible to tag a release for Laravel 10?
I can't seem to find any requirement for the service provider or facade. Even the tests run perfectly without loading the service provider.
orchestra/testbench
doesn't support package discovery.
I have a Laravel 7 project which has a table Orders and a table Statuses with a OneToMany relationship and I would like to send different email notifications based on the different status_id present on the Order Model/Table.
I am struggling to understand how to use this so I was wondering if someone could please share some examples or advices on how to implement this.
Do I have to publish the package first?
Can it be used on a status_id field on the table rather than a string ?
Do I have to import the package from somewhere specific in my Model ?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.