wn/lumen-generators
wn/lumen-generators adds Laravel-style Artisan generator commands to Lumen, so you can quickly scaffold models, controllers, middleware, migrations, seeders, requests, and other common classes. It brings familiar make:* workflows and faster scaffolding to Lumen apps that lack them.
composer require --dev wn/lumen-generators
bootstrap/app.php:
$app->register(Wn\LumenGenerators\LumenGeneratorsServiceProvider::class);
Check the package README for the exact FQCN if your installed version differs.composer install --no-dev:
if ($app->runningInConsole() && class_exists(Wn\LumenGenerators\LumenGeneratorsServiceProvider::class)) {
$app->register(Wn\LumenGenerators\LumenGeneratorsServiceProvider::class);
}
php artisan list
You should see make:controller, make:model, make:migration, make:seeder, make:middleware, and similar generators depending on the package version.php artisan make:model Post -m
php artisan make:controller PostController
php artisan make:seeder PostsTableSeeder
php artisan help make:controller and the package README for supported options. Then inspect each generated file; the generators produce boilerplate, not a finished feature.php artisan make:migration create_posts_table
php artisan make:migration add_status_to_posts_table --table=posts
The generated class name and filename timestamp follow Laravel’s migration conventions.php artisan make:controller Admin/PostController
Verify the generated namespace matches your PSR-4 mapping; adjust manually if your app namespace differs from App\.bootstrap/app.php:
$app->middleware([
App\Http\Middleware\Authenticate::class,
]);
$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
app/Console/Kernel.php under the $commands array. Lumen does not auto-register command classes the way some Laravel setups do.$app->withEloquent() in bootstrap/app.php and configure DB_* environment variables before expecting generated models or seeders to work.DatabaseSeeder or invoke it explicitly:
php artisan db:seed --class=PostsTableSeeder
Makefile, Composer script, or onboarding doc. Scaffolding becomes repeatable, and reviewers know which files came from a generator versus hand-written logic.make: commands cover this functionality, and old command signatures may break against newer framework versions.bootstrap/app.php; you ran composer dump-autoload; you are running php artisan from the project root; and the provider registration is not accidentally skipped by a runningInConsole() guard during local testing.$app->register(...) line is the usual reason the generators appear to be “installed but missing.”--no-dev, bootstrap will fail with a class-not-found error. Wrap registration in class_exists() and/or console-only checks.App\ namespace and Lumen’s default app/ directory. If your application uses a custom namespace or directory layout, edit the generated namespaces and paths, or fork the package stubs.PostController.php containing class Postcontroller will fail on Linux even if it works on macOS.ValidatesRequests or AuthorizesRequests. Add the traits or remove the references based on what your Lumen app actually provides.$app->withEloquent(). The generator only writes the migration file; it does not configure the database or run the migration.php -l on generated PHP files and composer dump-autoload -o after scaffolding. This catches syntax issues and autoload mismatches early.vendor/wn/lumen-generators/. If you need project-specific scaffolding, copy the stubs or write a small custom Artisan command rather than editing files inside vendor/.composer.json and commit composer.lock. Given the 2017 release date, expect no upstream fixes; treat it as a frozen development convenience for legacy Lumen 5.x codebases.How can I help you explore Laravel packages today?