Skip to content

Commit 37b869a

Browse files
authored
Merge pull request #68 from branchzero/support-lumen
Support Lumen framework
2 parents d81e850 + d9c7052 commit 37b869a

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
@@ -51,11 +51,17 @@ public function requestClass() {
5151
*/
5252
public function getApplication()
5353
{
54-
require_once 'bootstrap/autoload.php';
54+
if (file_exists('bootstrap/autoload.php')) {
55+
require_once 'bootstrap/autoload.php';
56+
}
5557

5658
// Laravel 5 / Lumen
59+
$isLaravel = true;
5760
if (file_exists('bootstrap/app.php')) {
5861
$this->app = require_once 'bootstrap/app.php';
62+
if (substr($this->app->version(), 0, 5) === 'Lumen') {
63+
$isLaravel = false;
64+
}
5965
}
6066

6167
// Laravel 4
@@ -67,7 +73,7 @@ public function getApplication()
6773
throw new \RuntimeException('Laravel bootstrap file not found');
6874
}
6975

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

7278
return $kernel;
7379
}

0 commit comments

Comments
 (0)