Getting Started
Migrate from Lumen to StrataPHP
Lumen reached end-of-life with Laravel 11. StrataPHP offers a modular MVC alternative for PHP 8.2+.
On this page
1. Routing
Both use closure-based routes. StrataPHP uses $router->get() instead of Lumen's $router->get() or $app->get().
Lumen
$router->get('/api/users', function () {
return response()->json(User::all());
});
StrataPHP
$router->get('/api/users', function () {
$users = DB::table('users')->get();
return $this->jsonResponse($users);
});
Change: response()->json() → $this->jsonResponse(). Eloquent → StrataPHP DB class.
2. Database
StrataPHP does not ship with Eloquent. It uses a lightweight PDO wrapper via strata/database.
use StrataPHP\Database\DB;
// Lumen/Eloquent: User::all()
// StrataPHP:
$users = DB::table('users')->get();
To keep using Eloquent, you can install illuminate/database and bootstrap it manually, but it's not included by default.
3. Key Differences
| StrataPHP | Lumen | |
|---|---|---|
| Maintenance | Active development | EOL as of Laravel 11 |
| Database | Custom PDO wrapper | Eloquent ORM |
| Structure | Modular MVC with /app, /config, /public |
Single file or minimal structure |
| Modules | Admin, CMS, Auth available | None built-in |
Migration Steps
composer create-project strataphp/skeleton my-api- Copy
routes/web.phpfrom Lumen to StrataPHProutes/web.php - Replace Eloquent calls with
DB::table()or installilluminate/databasemanually - Replace
response()->json()with$this->jsonResponse() - Test routes individually
Time estimate: Varies by project size. Basic APIs can port in 2-4 hours.
Why Switch from Lumen?
Lumen is no longer receiving feature updates. StrataPHP provides a maintained path for micro-framework apps with optional modules for admin, CMS, and auth if you need them later.
Need Help?
Post in Discord with your Lumen routes and we'll help you port them.