- Create a directory in laravel application called lumen
lumen
public
.htaccess
index.php
config
- api.php
- jwt.php
bootstrap.php
-
Grab content from
bootstrap/app.php
and paste it intolumen\bootstrap.php
-
Replace
App\Console\Kernel::class
withApp\Lumen\Console\Kernel::class
. -
Comment out the current route
$app->group(['namespace' => 'App\Http\Controllers'],...
and use the following route:
$app->get('/', function () use ($app) {
return $app->version();
});
-
Copy Lumen's
app
folder into Laravel'sapp
folder asLumen
. -
Update the namespace of
namespace App\
folder tonamespace App\Lumen\
. -
In Laravel root folder, run
composer require laravel/lumen
to include Lumen package dependencies.
Now you may run in Laravel's public directory php artisan serve
and Lumen's public folder php -S localhost:9000
to serve both application. You should see Laravel and Lumen default.