Skip to content

Commit 6694ebc

Browse files
authored
fix: filter vendor paths from registered loaders in Application::inferBasePath (#54119)
1 parent f7bee97 commit 6694ebc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Illuminate/Foundation/Application.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,10 @@ public static function inferBasePath()
254254
{
255255
return match (true) {
256256
isset($_ENV['APP_BASE_PATH']) => $_ENV['APP_BASE_PATH'],
257-
default => dirname(array_keys(ClassLoader::getRegisteredLoaders())[0]),
257+
default => dirname(array_values(array_filter(
258+
array_keys(ClassLoader::getRegisteredLoaders()),
259+
fn ($path) => ! str_contains($path, '/vendor/'),
260+
))[0]),
258261
};
259262
}
260263

0 commit comments

Comments
 (0)