Skip to content

Artisan commands

Module lifecycle

CommandDescription
make:module {name} [--layout=ddd|simple|contracts] [--force]Scaffold a new module.
module:listList all modules with their status.
module:enable {module}Enable a module (writes modules_statuses.json).
module:disable {module}Disable a module.
module:cacheCompile discovery + attributes into a fast cache (see Performance).
module:clearRemove the compiled cache.
module:promote {module} [--export=PATH]Print the promotion plan; --export copies the module out (non-destructive).

In-module generators

Generate classes inside an existing module (DDD layout):

CommandCreates
module:make-controller {module} {name}src/Infrastructure/Http/Controllers/{Name}Controller.php
module:make-model {module} {name}src/Infrastructure/Persistence/Models/{Name}.php
module:make-action {module} {name}src/Application/UseCases/{Name}.php
module:make-migration {module} {name} [--table=]timestamped migration in database/migrations
bash
php artisan module:make-controller Blog ShowPost
php artisan module:make-action Blog PublishPost
php artisan module:make-migration Blog create_posts_table --table=posts