'php artisan make:controller is not defined

I am using Laravel Framework 6.20.44, which I can tell from php artisan -V It comes part of OctoberCMS, which I just updated.

I'm jealous because the documentation for Laravel 6.x, and some many other resources, show that php artisan come with a make command, derived into so many subcommands.

I would like to enjoy a command like php artisan make:controller API/TopicController --api.

I can't, because my version of artisan returns:

Command "make:controller" is not defined.

Did you mean one of these?
create:controller
make:migration

It looks like I have an older version of artisan, heavily coupled to October. I say coupled because I can spot commands such as october: when I list available artisan commands.

No luck with create:controller either, as --api is not implemented in my version...

My question: how do I update artisan so that I have access to the make command, according to the doco?



Solution 1:[1]

October CMS is developed in Laravel and it's not framework. It is CMS.

So, being CMS it has to maintain its directory structure with predefined paths. CMS is driven by plugins and themes. So you can only add/modify plugins or theme files.

So now if you try to add a controller where do it will add? it cants add to its system files OR in app/controllers/. To prevent this the authors of CMS have removed/overrideLaravel native commands to avoid creating the unexpected directory structure or files in core folders.

So basically you need to follow CMS rules and its command to maintain the directory structure and file structure of CMS. It's important otherwise CMS will not work.

php artisan create:controller <Author>:<PluginName> <ControllerName>

this is the exact definition: Create the controller in this plugin by this name. So it can work with CMS core logic.

Check some tutorials to understand how October CMS works:

If any doubts please comment.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1