Skip to content
Advertisement

InvalidArgumentException when creating model through artisan

I am new to Laravel and is encountering a problem when I start a new laravel project.
My current environment is: PHP 7.4.14 on Linux (Manjaro) & Composer 2.0.9.

I use the following command to initialize a laravel project:

JavaScript

Then I switch to the directory of lara and type:

JavaScript

And then, I got an InvalidArgumentException: Model name contains invalid characters.

JavaScript

I am confused and dunno what I have done wrong so I would like to seek your helps. Thank you very much in advance.

Advertisement

Answer

php artisan make:controller PhotoController --resource --model=Photo

it should be “–model”. The parameters are prefixed with double “-“!

More

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement