Artisan.page

make:controller

Create a new controller class

Terminal
php artisan make:controller [--api] [--type TYPE] [--force] [-i|--invokable] [-m|--model [MODEL]] [-p|--parent [PARENT]] [-r|--resource] [-R|--requests] [-s|--singleton] [--creatable] [--test] [--pest] [--phpunit] [--] <name>

Options

apiOptional

Exclude the create and edit methods from the controller

creatableOptional

Indicate that a singleton resource should be creatable

forceOptional

Create the class even if the controller already exists

invokableOptional

Generate a single method, invokable controller class

modelOptional

Generate a resource controller for the given model

parentOptional

Generate a nested resource controller class

pestOptional

Generate an accompanying Pest test for the Controller

phpunitOptional

Generate an accompanying PHPUnit test for the Controller

requestsOptional

Generate FormRequest classes for store and update

resourceOptional

Generate a resource controller class

singletonOptional

Generate a singleton resource controller class

testOptional

Generate an accompanying Test test for the Controller

typeRequired

Manually specify the controller stub file to use

Arguments

nameRequired

The name of the controller