Skip to content

Commit 605e4db

Browse files
authored
Support Lumen
1 parent b373b03 commit 605e4db

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Bootstraps/Laravel.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,17 @@ public function requestClass() {
5858
*/
5959
public function getApplication()
6060
{
61-
require_once 'bootstrap/autoload.php';
61+
if (file_exists('bootstrap/autoload.php')) {
62+
require_once 'bootstrap/autoload.php';
63+
}
6264

6365
// Laravel 5 / Lumen
66+
$isLaravel = true;
6467
if (file_exists('bootstrap/app.php')) {
6568
$this->app = require_once 'bootstrap/app.php';
69+
if (str_contains($this->app->version(), 'Lumen')) {
70+
$isLaravel = false;
71+
}
6672
}
6773

6874
// Laravel 4
@@ -74,7 +80,7 @@ public function getApplication()
7480
throw new \RuntimeException('Laravel bootstrap file not found');
7581
}
7682

77-
$kernel = $this->app->make('Illuminate\Contracts\Http\Kernel');
83+
$kernel = $this->app->make($isLaravel ? 'Illuminate\Contracts\Http\Kernel' : 'Laravel\Lumen\Application');
7884

7985
return $kernel;
8086
}

0 commit comments

Comments
 (0)