-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Eloquent Model Event Handling Attributes e.g. #[Listener('created')] #58
Add Eloquent Model Event Handling Attributes e.g. #[Listener('created')] #58
Conversation
Hey @marvinosswald thanks for the kind words! Can you provide some examples showing how these attributes would be better than the current syntax with some real life examples? Please create a discussion in the Ideas category for that and add the link of this PR there, so we can discuss there! |
@WendellAdriel i've incorporated naming changes we discussed as well as adding queuable for Listeners And because i like laravels general approach of overridable convention, we can now use For custom event dispatching i did the same you can register events like this If you feel like those convention based usages are to ambigious let me know and i remove them again, just felt so much more comfortable to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just made some observations regarding the code.
Also, since this is a new feature with a lot of details, can you also create a PR in the docs repo for it, please?
@WendellAdriel i'll be working on a docs PR, i'll prepare a PR based on unchecked Markdown. Please advice if there is a better possibility with gitbooks, thanks. |
@WendellAdriel created a PR on the docs repo for this: WendellAdriel/laravel-lift-docs#2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good here! 🔥
I'm going to merge this but I'll wait for the docs to be ready to release the new version! |
Handling Events with listeners on your Model with lifts fantastic syntax, Thanks for making this library IMHO this should be part of the framework seems like a no-brainer to me ever since I saw Caleb's talk on Laracon Us this year.
This PR supports every Model Event documented.
Listener
Observer
Dispatches
Convention based