Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

venoel's avatar

The "-c" option does not exist in Laravel (artisan)

I am trying to create model with command

php artisan make:model -r -c ManagerModel

Getting message

PHP Symfony\Component\Console\Exception\RuntimeException: The "-r" option does not exist.

But model and controller are created.

I am trying to create model with command

php artisan make:model -c ManagerModel

Getting message

PHP Symfony\Component\Console\Exception\RuntimeException: The "-c" option does not exist.

But model and controller are still created.

I am trying to create model with command

php artisan make:model ManagerModel

Getting message

PHP Symfony\Component\Console\Exception\RuntimeException: No arguments expected for "make:model" command, got "ManagerModel".

And model is still created.

Manual says:

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>

I am confused. Why such errors are shown and what they mean if model (controller) created anyway?

> php -v
PHP 8.1.27 (cli) (built: Dec 21 2023 20:19:54) (NTS)
> php artisan --version
Laravel Framework 10.42.0
0 likes
2 replies
Snapey's avatar

whats the history of this project?

What does php artisan make:model --help say?

venoel's avatar
$ php artisan make:model --help
Description:
  Create a new Eloquent model class

Usage:
  make:model [options] [--] <name>

Arguments:
  name                  The name of the model

Options:
  -a, --all             Generate a migration, seeder, factory, policy, resource controller, and form request classes for the model
  -c, --controller      Create a new controller for the model
  -f, --factory         Create a new factory for the model
      --force           Create the class even if the model already exists
  -m, --migration       Create a new migration file for the model
      --morph-pivot     Indicates if the generated model should be a custom polymorphic intermediate table model
      --policy          Create a new policy for the model
  -s, --seed            Create a new seeder for the model
  -p, --pivot           Indicates if the generated model should be a custom intermediate table model
  -r, --resource        Indicates if the generated controller should be a resource controller
      --api             Indicates if the generated controller should be an API resource controller
  -R, --requests        Create new form request classes and use them in the resource controller
      --test            Generate an accompanying PHPUnit test for the Model
      --pest            Generate an accompanying Pest test for the Model
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Please or to participate in this conversation.