-
Notifications
You must be signed in to change notification settings - Fork 32
Commands
Tip: You can use the following commands with the --help suffix to find its arguments and options.
Generate a new module.
php artisan module:make my-blogGenerate multiple modules at once.
php artisan module:make my-blog projects crmUse a given module. This allows you to not specify the module name on other commands requiring the module name as an argument.
php artisan module:use my-blogThis unsets the specified module that was set with the module:use command.
php artisan module:unuseList all available modules.
php artisan module:listMigrate the given module, or without a module an argument, migrate all modules.
php artisan module:migrate my-blogRollback the given module, or without an argument, rollback all modules.
php artisan module:migrate-rollback my-blogRefresh the migration for the given module, or without a specified module refresh all modules migrations.
php artisan module:migrate-refresh my-blogReset the migration for the given module, or without a specified module reset all modules migrations.
php artisan module:migrate-reset my-blogSeed the given module, or without an argument, seed all modules
php artisan module:seed my-blogPublish the migration files for the given module, or without an argument publish all modules migrations.
php artisan module:publish-migration my-blogPublish the given module configuration files, or without an argument publish all modules configuration files.
php artisan module:publish-config my-blogPublish the translation files for the given module, or without a specified module publish all modules migrations.
php artisan module:publish-translation my-blogEnable the given module.
php artisan module:enable my-blogDisable the given module.
php artisan module:disable my-blogUpdate the given module.
php artisan module:update my-blogGenerate the given console command for the specified module.
php artisan module:make-command CreatePostCommand my-blogGenerate a migration for specified module.
php artisan module:make-migration create_posts_table my-blogGenerate the given seed name for the specified module.
php artisan module:make-seed seed_fake_blog_posts my-blogGenerate a controller for the specified module.
php artisan module:make-controller Posts my-blogGenerate the given model for the specified module.
php artisan module:make-model Post my-blogOptional options:
-
--fillable=field1,field2: set the fillable fields on the generated model -
--migration,-m: create the migration file for the given model -
--factory,-f: create the factory file for the given model
Generate the given service provider name for the specified module.
php artisan module:make-provider Event my-blogGenerate the given middleware name for the specified module.
php artisan module:make-middleware CanReadPostsMiddleware my-blogGenerate the given mail class for the specified module.
php artisan module:make-mail SendWeeklyPostsEmail my-blogGenerate the given notification class name for the specified module.
php artisan module:make-notification NotifyAdminOfNewComment my-blogGenerate the given listener for the specified module. Optionally you can specify which event class it should listen to. It also accepts a --queued flag allowed queued event listeners.
php artisan module:make-listener NotifyUsersOfANewPost my-blog
php artisan module:make-listener NotifyUsersOfANewPost my-blog --event=PostWasCreated
php artisan module:make-listener NotifyUsersOfANewPost my-blog --event=PostWasCreated --queuedGenerate the given request for the specified module.
php artisan module:make-request CreatePostRequest my-blogGenerate the given event for the specified module.
php artisan module:make-event BlogPostWasUpdated my-blogGenerate the given job for the specified module.
php artisan module:make-job JobName my-blog
php artisan module:make-job JobName my-blog --sync # A synchronous job classGenerate the given database factory for the specified module.
php artisan module:make-factory FactoryName my-blogGenerate the given policy class for the specified module.
The Policies is not generated by default when creating a new module. Change the value of paths.generator.policy in config/module.php to your desired location.
php artisan module:make-policy PolicyName my-blogGenerate the given validation rule class for the specified module.
The Rules folder is not generated by default when creating a new module. Change the value of paths.generator.rules in config/module.php to your desired location.
php artisan module:make-rule ValidationRule my-blogGenerate the given API resource class for the specified module. It can have an optional --collection argument to generate a resource collection.
The Http/Resources folder is not generated by default when creating a new module. Change the value of paths.generator.resource in config/module.php to your desired location.
php artisan module:make-resource PostResource my-blog
php artisan module:make-resource PostResource my-blog --collectionGenerate the given test class for the specified module.
php artisan module:make-test EloquentPostRepositoryTest my-blogGenerate the given view component for the specified module.
php artisan module:make-component MyAlert my-blogGenerate the given cast class for the specified module.
The Casts is not generated by default when creating a new module. Change the value of paths.generator.cast in config/module.php to your desired location.
php artisan module:make-cast CastName my-blogGenerate the given observer class for the specified module.
The Observers is not generated by default when creating a new module. Change the value of paths.generator.observer in config/module.php to your desired location.
php artisan module:make-observer ObserverName my-blog
php artisan module:make-observer ObserverName my-blog --model=PostOptional options:
-
--model,-m: create the observer file for the given model
Generate the given exception class for the specified module.
The Exceptions is not generated by default when creating a new module. Change the value of paths.generator.exception in config/module.php to your desired location.
php artisan module:make-exception ExceptionName my-blog