Artisan Utility Commands

Edit on

Tip:

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

Note: All of the following commands use "Blog" as an example module name, and example class/file names.

module:disable

Disable the specified module.

                    
                        php artisan module:disable Blog
                    
                

module:enable

Enable the specified module.

                    
                        php artisan module:enable Blog
                    
                

module:list

List all available modules.

                    
                        php artisan module:list
                    
                

module:migrate

Run migrations for the specified module. To run migrations for all modules, simply omit the module argument.

                    
                        php artisan module:migrate Blog
                    
                

Options:

  • --direction, -d : The order to load the modules (only applies when migrating all modules). Valid values are asc and desc. Default: asc
  • --database=Database : The database connection to use.
  • --pretend, -p : Dump the SQL queries that would be run in the migrations.
  • --force, -f : Force the migrations to run in production.
  • --seed, -s : Indicates seeders should be run.
  • --subpath=Subpath : Indicate a subpath to run your migrations from.

module:migrate-refresh

Refresh migrations for the specified module. To refresh migrations for all modules, simply omit the module argument.

                    
                        php artisan module:migrate-refresh Blog
                    
                

Options:

  • --database=Database : The database connection to use.
  • --force, -f : Force the migrations to run in production.
  • --seed, -s : Indicates seeders should be run.

module:migrate-reset

Reset migrations for the specified module. To reset all module migrations, simply omit the module argument.

                    
                        php artisan module:migrate-reset Blog
                    
                

Options:

  • --direction, -d : The order to load the modules (only applies when migrating all modules). Valid values are asc and desc. Default: desc
  • --database=Database : The database connection to use.
  • --pretend, -p : Dump the SQL queries that would be run in the migrations.
  • --force, -f : Force the migrations to run in production.

module:migrate-rollback

Rollback migrations for the specified module. To rollback all module migrations, simply omit the module argument.

                    
                        php artisan module:migrate-rollback Blog
                    
                

Options:

  • --direction, -d : The order to load the modules (only applies when migrating all modules). Valid values are asc and desc. Default: desc
  • --database=Database : The database connection to use.
  • --pretend, -p : Dump the SQL queries that would be run in the migrations.
  • --force, -f : Force the migrations to run in production.

module:publish-config

Publish the configuration files for the specified module. To publish all module configurations, simply omit the module argument.

                    
                        php artisan module:publish-config Blog
                    
                

Options:

  • --force, -f : Force the configuration files to publish.

module:publish-migration

Publish the migration files for the specified module. To publish all module migrations, simply omit the module argument.

                    
                        php artisan module:publish-migration Blog
                    
                

module:publish-translation

Publish the translation files for the specified module. To publish all module translations, simply omit the module argument.

                    
                        php artisan module:publish-translation Blog
                    
                

module:seed

Run database seeds for the specified module. To seed all modules, simply omit the module argument.

                    
                        php artisan module:seed Blog
                    
                

Options:

  • --class=RootClass : The class name of the root seeder.
  • --database=Database : The database connection to use use

module:update

Update the specified module.

                    
                        php artisan module:update Blog
                    
                

module:use

Use the specified module. This allows you to not have to specify the module name on other commands that require the module name as an argument.

                    
                        php artisan module:use Blog
                    
                

module:unuse

This unsets the module that was set with the module:use command. It takes no arguments.

                    
                        php artisan module:unuse