From 1f7b884e6111e245b7075898faa7aa13bff0bb20 Mon Sep 17 00:00:00 2001 From: xizprodev <82259632+xizprodev@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:20:30 +0300 Subject: [PATCH] DiscoverEvents::classFromFile (#52976) --- src/Illuminate/Foundation/Events/DiscoverEvents.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Events/DiscoverEvents.php b/src/Illuminate/Foundation/Events/DiscoverEvents.php index a4728c2ef3ed..51e1b1b3769a 100644 --- a/src/Illuminate/Foundation/Events/DiscoverEvents.php +++ b/src/Illuminate/Foundation/Events/DiscoverEvents.php @@ -100,11 +100,11 @@ protected static function classFromFile(SplFileInfo $file, $basePath) $class = trim(Str::replaceFirst($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR); - return str_replace( + return ucfirst(Str::camel(str_replace( [DIRECTORY_SEPARATOR, ucfirst(basename(app()->path())).'\\'], ['\\', app()->getNamespace()], ucfirst(Str::replaceLast('.php', '', $class)) - ); + ))); } /**