-
-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Description
Winter CMS Build
dev-develop
PHP Version
8.4
Database engine
MySQL/MariaDB
Plugins installed
No response
Issue description
Using Artisan::add in init.php file how described here https://wintercms.com/docs/v1.2/docs/console/introduction#registering-a-console-command i get this error Call to undefined method Winter\Storm\Foundation\Console\Kernel::add()
Steps to replicate
Create a init.php file in the root of your plugin then add your console command with:
Artisan::add(new MyAuthor\MyPlugin\Console\MyCommand);
Workaround
Use registerConsoleCommand helper method in the register method of a Plugin registration file
class MyPlugin extends PluginBase
{
public function register()
{
$this->registerConsoleCommand('myauthor.mycommand', \MyAuthor\MyPlugin\Console\MyCommand::class);
}
}
Metadata
Metadata
Assignees
Labels
No labels