The Laravel Artisan Cheatsheet now has an API. Learn more.

make:model

Create a new Eloquent model class

Options

  • all - Generate a migration, seeder, factory, and resource controller for the model Optional
  • controller - Create a new controller for the model Optional
  • factory - Create a new factory for the model Optional
  • force - Create the class even if the model already exists Optional
  • migration - Create a new migration file for the model Optional
  • seed - Create a new seeder file for the model Optional
  • pivot - Indicates if the generated model should be a custom intermediate table model Optional
  • resource - Indicates if the generated controller should be a resource controller Optional
  • api - Indicates if the generated controller should be an API controller Optional

Arguments

  • name - The name of the class Required
php artisan make:model [-a|--all] [-c|--controller] [-f|--factory] [--force] [-m|--migration] [-s|--seed] [-p|--pivot] [-r|--resource] [--api] [--] <name>