statamic / docs

Statamic Documentation
https://statamic.dev
Other
117 stars 383 forks source link

Document changes to add-on listener auto-registration #1515

Closed leewillis77 closed 1 month ago

leewillis77 commented 1 month ago

I've opened a PR against the CMS (https://github.com/statamic/cms/pull/11009) that changes the behaviour of add-on event listener auto-registration as documented here: https://statamic.dev/extending/addons

I'd suggest that the Tip at the top of that page is updated to add 'or __invoke' as per the changes in bold below if that PR is accepted:

"As long as your event listener lives in src/Listeners and the event is typehinted in the listener’s handle or __invoke method, they will be automatically registered by Statamic, without you needing to register them manually."