Artisan.page

make:model

Create a new Eloquent model class

Terminal
php artisan make:model [-a|--all] [-c|--controller] [-f|--factory] [--force] [-m|--migration] [--morph-pivot] [--policy] [-s|--seed] [-p|--pivot] [-r|--resource] [--api] [-R|--requests] [--test] [--pest] [--] <name>

Options

allOptional

Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model

apiOptional

Indicates if the generated controller should be an API resource controller

controllerOptional

Create a new controller for the model

factoryOptional

Create a new factory for the model

forceOptional

Create the class even if the model already exists

migrationOptional

Create a new migration file for the model

morph-pivotOptional

Indicates if the generated model should be a custom polymorphic intermediate table model

pestOptional

Generate an accompanying Pest test for the Model

pivotOptional

Indicates if the generated model should be a custom intermediate table model

policyOptional

Create a new policy for the model

requestsOptional

Create new form request classes and use them in the resource controller

resourceOptional

Indicates if the generated controller should be a resource controller

seedOptional

Create a new seeder for the model

testOptional

Generate an accompanying PHPUnit test for the Model

Arguments

nameRequired

The name of the model