Create a new controller class of a module.
1php artisan module:make:controller [module-name] [controller-name]
Option | Description |
---|---|
-m, --model[=MODEL] |
The model class that related to the controller |
--force |
Create the class even if the controller already exists |
--test |
Generate an accompanying PHPUnit test for the Controller |
--pest |
Generate an accompanying Pest test for the Controller |
Create a new form request class of a module.
1php artisan module:make:request [module-name] [request-name]
Option | Description |
---|---|
-j, --json |
Create a new jsonable form request |
Create a new resource of a module.
1php artisan module:make:resource [module-name] [resource-name]
Option | Description |
---|---|
-j, --json |
Create a new jsonable resource |
-c, --collection |
Create a resource collection |
Create a new middleware class of a module.
1php artisan module:make:middleware [module-name] [middleware-name]
Option | Description |
---|---|
--test |
Generate an accompanying PHPUnit test for the Middleware |
--pest |
Generate an accompanying Pest test for the Middleware |
Create a new Eloquent model class of a module.
1php artisan module:make:model [module-name] [model-name]
Option | Description |
---|---|
-a, --all |
Create a new migration, fatcory, seeder and policy files for the model |
-m, --migration |
Create a new migration file for the model |
-f, --factory |
Create a new factory for the model |
-s, --seed |
Create a new seeder for the model |
-p, --policy |
Create a new policy for the model |
--force |
Create the class even if the model already exists |
--test |
Generate an accompanying PHPUnit test for the Model |
--pest |
Generate an accompanying Pest test for the Model |
Create a new observer class of a module.
1php artisan module:make:observer [module-name] [observer-name]
Option | Description |
---|---|
--model[=MODEL] |
The model that the observer applies to |
Create a new migration file of a module.
1php artisan module:make:migration [module-name] [migration-name]
Option | Description |
---|---|
--create[=CREATE] |
The table to be created |
--table[=TABLE] |
The table to migrate |
Create a new seeder class of a module.
1php artisan module:make:seeder [module-name] [seeder-name]
Create a new service provider class of a module.
1php artisan module:make:provider [module-name] [provider-name]
Create a new service provider class of a module.
1php artisan module:make:provider [module-name] [provider-name]
Create a new custom Eloquent cast class of a module.
1php artisan module:make:cast [module-name] [cast-name]
Create a new channel class of a module.
1php artisan module:make:channel [module-name] [channel-name]
Create a new Artisan command of a module.
1php artisan module:make:command [module-name] [command-name]
Option | Description |
---|---|
--test |
Generate an accompanying PHPUnit test for the Command |
--pest |
Generate an accompanying Pest test for the Command |
--command |
The terminal command that should be assigned [default: "command:name"] |
Create a new view component of a module.
1php artisan module:make:component [module-name] [component-name]
Option | Description |
---|---|
--force |
Create the class even if the component already exists |
--inline |
Create a component that renders an inline view |
Create a new event class of a module.
1php artisan module:make:event [module-name] [event-name]
Create a new custom exception class of a module.
1php artisan module:make:exception [module-name] [exception-name]
Option | Description |
---|---|
--render |
Create the exception with an empty render method |
--report |
Create the exception with an empty report method |
Create a new model factory of a module.
1php artisan module:make:factory [module-name] [factory-name]
Create a new job class of a module.
1php artisan module:make:job [module-name] [job-name]
Option | Description |
---|---|
--sync |
Indicates that job should be synchronous |
--test |
Generate an accompanying PHPUnit test for the Job |
--pest |
Generate an accompanying Pest test for the Job |
Create a new event listener class of a module.
1php artisan module:make:listener [module-name] [listener-name]
Option | Description |
---|---|
-e, --event[=EVENT] |
The event class being listened for |
--queued |
Indicates the event listener should be queued |
--test |
Generate an accompanying PHPUnit test for the Listener |
--pest |
Generate an accompanying Pest test for the Listener |
Create a new email class of a module.
1php artisan module:make:mail [module-name] [mail-name]
Option | Description |
---|---|
-f, --force |
Create the class even if the mailable already exists |
-m, --markdown[=MARKDOWN] |
Create a new Markdown template for the mailable [default: false] |
--test |
Generate an accompanying PHPUnit test for the Mail |
--pest |
Generate an accompanying Pest test for the Mail |
Create a new notification class of a module.
1php artisan module:make:notification [module-name] [notification-name]
Option | Description |
---|---|
-f, --force |
Create the class even if the notification already exists |
-m, --markdown[=MARKDOWN] |
Create a new Markdown template for the notification |
--test |
Generate an accompanying PHPUnit test for the Notification |
--pest |
Generate an accompanying Pest test for the Notification |
Create a new policy class of a module.
1php artisan module:make:policy [module-name] [policy-name]
Option | Description |
---|---|
--guard[=GUARD] |
The guard that the policy relies on |
--model[=MODEL] |
The model that the policy applies to |
Create a new validation rule of a module.
1php artisan module:make:rule [module-name] [rule-name]
Create a new test class of a module.
1php artisan module:make:test [module-name] [test-name]
Option | Description |
---|---|
-u, --unit |
reate a unit test |
-p, --pest |
Create a Pest test |
Drop all tables then re-run migrations of a module.
1php artisan module:migrate:fresh [module-name]
Option | Description |
---|---|
--drop-views |
Drop all tables and views |
--drop-types |
Drop all tables and types (Postgres only) |
--force |
Force the operation to run when in production |
--seed |
Indicates if the seed task should be re-run |
--seeder[=SEEDER] |
The class name of the root seeder |
--schema-path[=SCHEMA-PATH] |
The path to a schema dump file |
--step[=STEP] |
Force the migrations to be run so they can be rolled back individually |
Reset and re-run all module migrations.
1php artisan module:migrate:refresh [module-name]
Option | Description |
---|---|
--force |
Force the operation to run when in production |
--seed |
Indicates if the seed task should be re-run |
--seeder[=SEEDER] |
The class name of the root seeder |
--step[=STEP] |
The number of migrations to be reverted & re-run |
Rollback all database migrations of a module.
1php artisan module:migrate:reset [module-name]
Option | Description |
---|---|
--force |
Force the operation to run when in production |
Show the status of each migration of a module.
1php artisan module:migrate:status [module-name]
Get routes list of a specific module.
1php artisan module:routes
Option | Description |
---|---|
-r, --reverse |
Reverse the ordering of the routes |
--json |
Output the route list as JSON |
--method[=METHOD] |
Filter the routes by method |
--sort[=SORT] |
The column (precedence, domain, method, uri, name, action, middleware) to sort by [default: "uri"] |
Seed the database with records of a module.
1php artisan module:seed [module-name]
Option | Description |
---|---|
--force |
Force the operation to run when in production |
--class[=CLASS] |
The class name of the root seeder [default: "DatabaseSeeder"] |
Run the module tests.
1php artisan module:test [module-name]
Option | Description |
---|---|
-l, --list |
Get tests list |
-s, --stop-on-failure |
Stop all tests on the failure status |
-f, --filter[=FILTER] |
Test name (example: UserTest) |