Framework: make:controller --api produces "The --api option does not exist" error

Created on 12 Mar 2018  路  3Comments  路  Source: laravel/framework

  • Laravel Version: 5.5.39
  • PHP Version: 7.1.9
  • Database Driver & Version: MySQL 5.7.19

Description:

When attempting to create an API resource controller using the --api switch, the process fails and the following error message is displayed:

The "--api" option does not exist.

Running the php artisan make:controller command _without_ the --api flag works as expected.

Steps To Reproduce:

Run the following command (taken straight from the docs):

php artisan make:controller API/PhotoController --api

Most helpful comment

The --api option was added in Laravel 5.6.

All 3 comments

The --api option was added in Laravel 5.6.

I don't think that your Laravel version supports this feature. If you take a look at the docs for 5.5, you will not find anything about it.

Ah, thank you! I missed that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kerbylav picture kerbylav  路  3Comments

SachinAgarwal1337 picture SachinAgarwal1337  路  3Comments

felixsanz picture felixsanz  路  3Comments

jackmu95 picture jackmu95  路  3Comments

RomainSauvaire picture RomainSauvaire  路  3Comments