Laravel Modules — Artisan Commands

Useful Tip:

Joy Joel
3 min readDec 18, 2022

You can use the following commands with the --help suffix to find its arguments and options.

Note all the following commands use “Blog” as an example module name, and example class/file names

Utility commands

module:make

Generate a new module.

php artisan module:make Blog

module:make

Generate multiple modules at once.

php artisan module:make Blog User Auth

module:use

Use a given module. This allows you to not specific the module name on other commands requiring the module name as an argument.

php artisan module:use Blog

module:list

List all available modules.

php artisan module:list

module:migrate

Migrate the given module, or without a module an argument, migrate all modules.

php artisan module:migrate Blog

module:migrate-rollback

Rollback the given module, or without an argument, rollback all modules.

php artisan module:migrate-rollback Blog

module:migrate-refresh

--

--

Joy Joel

Abba’s Daughter| DevOps Engineer|Technical Writer