From e4796bc3385cfffbfe21a74e8e073998b3c59a2c Mon Sep 17 00:00:00 2001 From: Jascha <6311608+ya-cha@users.noreply.github.com> Date: Mon, 24 Jun 2024 22:11:31 +0200 Subject: [PATCH] [11.x] Add addEventDiscoveryPaths to EventServiceProvider (#51896) * Add addEventDiscoveryPaths to EventServiceProvider * Update EventServiceProvider.php --------- Co-authored-by: Jascha Co-authored-by: Taylor Otwell --- .../Support/Providers/EventServiceProvider.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php b/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php index 6259c0bf7704..8fdfe0bacd67 100644 --- a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php +++ b/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php @@ -168,6 +168,17 @@ protected function discoverEventsWithin() ]; } + /** + * Add the given event discovery paths to the application's event discovery paths. + * + * @param string|array $paths + * @return void + */ + public static function addEventDiscoveryPaths(array|string $paths) + { + static::$eventDiscoveryPaths = array_merge(static::$eventDiscoveryPaths, Arr::wrap($paths)); + } + /** * Set the globally configured event discovery paths. *