Migrate from Lumen to StrataPHP

Lumen was great. It taught us micro-frameworks work. StrataPHP continues that philosophy with active development. At the time of writing this Lumen is end-of-life. StrataPHP is the maintained, PSR-native replacement.

Lumen EOL Notice: Laravel team stopped Lumen development. No PHP 8.4 support planned. StrataPHP is actively maintained.

1. Routing — Identical

Lumen

$router->get('/api/users', function () {
    return response()->json(User::all());
});

StrataPHP

$router->get('/api/users', function () {
    return new JsonResponse(User::all());
});

Change: `response()->json()` → `new JsonResponse()`. That's it.

2. Service Container

Lumen uses `illuminate/container`. StrataPHP uses PSR-11. Keep using Illuminate if you want:

composer require illuminate/container
$container = new Illuminate\Container\Container();
$app = new App($container);

3. Eloquent

Works exactly the same. Lumen + StrataPHP both use `illuminate/database`.

composer require illuminate/database

// bootstrap/database.php — same as Lumen
$capsule = new Capsule;
$capsule->addConnection([...]);
$capsule->bootEloquent();

4. Key Differences

Maintenance Active EOL, security fixes only
PSR-7 Native Facade wrapper
Core Size ~450kb ~15MB
Boot ~3ms ~20ms
Modules Admin, CMS, Auth None

Migration Steps

  1. composer create-project strataphp/skeleton my-api
  2. Copy `routes/web.php` from Lumen to StrataPHP
  3. Copy `app/Models/` directory
  4. Copy `bootstrap/app.php` service providers → `config/services.php`
  5. Run tests. Should pass.

Time estimate: 1-2 hours. Lumen and StrataPHP are conceptually identical.

What You Gain

  • Future-proof — PHP 8.4, 8.5 support guaranteed
  • Smaller — 30x smaller vendor folder
  • Faster — No Laravel facade overhead
  • Modules — Add admin panel in 30 seconds

Stuck?

Lumen migrations are the easiest. If something breaks, post in Discord with your `routes/web.php` and we'll port it.