From fd07e202ef1efaa988cf7fdd8bbb253794410b0b Mon Sep 17 00:00:00 2001 From: Jared Cannon <60587282+jared-cannon@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:29:41 -0600 Subject: [PATCH] Add wildcard directory discovery to the EventServiceProvider (#53932) Co-authored-by: jared.cannon --- .../Foundation/Support/Providers/EventServiceProvider.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php b/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php index 9be8d5ce2ca7..37e35477411d 100644 --- a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php +++ b/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php @@ -146,6 +146,9 @@ public function shouldDiscoverEvents() public function discoverEvents() { return (new Collection($this->discoverEventsWithin())) + ->flatMap(function ($directory) { + return glob($directory, GLOB_ONLYDIR); + }) ->reject(function ($directory) { return ! is_dir($directory); })