Skip to content

Commit

Permalink
Merge pull request #28426 from paul-thebaud/5.8
Browse files Browse the repository at this point in the history
[5.8] Replace first occurrence instead of last for event discovery
  • Loading branch information
taylorotwell authored May 7, 2019
2 parents 506eedb + f70e7cc commit 2b539a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Events/DiscoverEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected static function getListenerEvents($listeners, $basePath)
*/
protected static function classFromFile(SplFileInfo $file, $basePath)
{
$class = trim(Str::replaceLast($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR);
$class = trim(Str::replaceFirst($basePath, '', $file->getRealPath()), DIRECTORY_SEPARATOR);

return str_replace(
[DIRECTORY_SEPARATOR, 'App\\'],
Expand Down

0 comments on commit 2b539a3

Please sign in to comment.