Skip to content

Commit b35ffe6

Browse files
committed
support .laravel directory
1 parent 450dd7f commit b35ffe6

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/ApplicationFactory.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ public function __construct(protected string $basePath)
2323
*/
2424
public function createApplication(array $initialInstances = []): Application
2525
{
26-
$path = $this->basePath.'/bootstrap/app.php';
27-
28-
if (! file_exists($path)) {
29-
throw new RuntimeException("Application bootstrap file not found [{$path}].");
26+
$paths = [
27+
$this->basePath.'/.laravel/app.php',
28+
$this->basePath.'/bootstrap/app.php',
29+
];
30+
31+
foreach ($paths as $path) {
32+
if (file_exists($path)) {
33+
return $this->warm($this->bootstrap(require $path, $initialInstances));
34+
}
3035
}
3136

32-
return $this->warm($this->bootstrap(require $path, $initialInstances));
37+
throw new RuntimeException("Application bootstrap file not found in 'bootstrap' or '.laravel' directory.");
3338
}
3439

3540
/**

0 commit comments

Comments
 (0)