Skip to content

Commit

Permalink
fix: filter vendor paths from registered loaders in Application::infe…
Browse files Browse the repository at this point in the history
…rBasePath (#54119)
  • Loading branch information
calebdw authored Jan 9, 2025
1 parent f7bee97 commit 6694ebc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ public static function inferBasePath()
{
return match (true) {
isset($_ENV['APP_BASE_PATH']) => $_ENV['APP_BASE_PATH'],
default => dirname(array_keys(ClassLoader::getRegisteredLoaders())[0]),
default => dirname(array_values(array_filter(
array_keys(ClassLoader::getRegisteredLoaders()),
fn ($path) => ! str_contains($path, '/vendor/'),
))[0]),
};
}

Expand Down

0 comments on commit 6694ebc

Please sign in to comment.