From 1f12fd6ed91bace6d421bc8b9fc33b4cb44213bd Mon Sep 17 00:00:00 2001 From: Lee Willis Date: Mon, 28 Oct 2024 10:54:54 +0000 Subject: [PATCH] Document support for event listener auto-registration from typehinted __invoke methods --- content/collections/extending-docs/addons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/collections/extending-docs/addons.md b/content/collections/extending-docs/addons.md index 4704c303c..54d2df0f6 100644 --- a/content/collections/extending-docs/addons.md +++ b/content/collections/extending-docs/addons.md @@ -443,7 +443,7 @@ return view('custom::foo'); ::: tip Statamic v5.33.0 introduced the concept of "autoloading" for event listeners. -As long as your event listener lives in `src/Listeners` and the event is typehinted in the listener's `handle` method, they will be automatically registered by Statamic, without you needing to register them manually. +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. Subscribers will also be autoloaded, as long as they live in `src/Subscribers`.