Add custom events to plugin
Hello,
I don't seem to see a way to add custom events (queued or not) to a plugon. Anyone who can guide me with this?
7 Replies
you could explain what is the goal, what code you are trying, etc..
Are you trying to use them in a plug-in you control or into someone else’s plugin?
I'm trying to write a plugin on my own, but it would require an event
event()
to be dispatched. I don't really know where I could register this event, because now I get the error that the event cant be found. I'm hoping I don't need to regiter it in the main application (just for the sake of simplicity for the user)ist the same as laravel events
this is an example how I did it
https://github.com/lara-zeus/bolt/tree/3.x/src/Events
But how do you register them?
Because I get (in the application I have it running) that the class is not found
you call it whereever you want
event()
and your users will listen to them
https://larazeus.com/docs/bolt/v3/advanced/eventsOhgod, I placed it outside of the src folder 🤦♂️
Thanks!!!