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

Nivatsi's avatar

The "--api" option does not exist. Error

Hi guys, I am writing this command to create a controller ;

php artisan make:controller Api\Admin\ProductController --api

But it shows this error : The "--api" option does not exist Help me please..

0 likes
5 replies
MichalOravec's avatar

Which version of Laravel do you use?

--api exists since Laravel 5.6

You can run which flags has that comand

php artisan make:controlle --help

To get version of Laravel run

php artisan -v
1 like
Nivatsi's avatar

Thank you MichalOravec. My problem was solved when I upgraded laravel version

Please or to participate in this conversation.