- 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.phpand paste it intolumen\bootstrap.php -
Replace
App\Console\Kernel::classwithApp\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
appfolder into Laravel'sappfolder asLumen. -
Update the namespace of
namespace App\folder tonamespace App\Lumen\. -
In Laravel root folder, run
composer require laravel/lumento 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.