Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Artisan:call is not working for package command

I am using Artisan::call to call a command from a package (that I have created) but its not finding that command and showing error
"message": "The command \"sync:reloadly\" does not exist.", "exception": "Symfony\\Component\\Console\\Exception\\CommandNotFoundException", "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php", "line": 182,

This command is working on console but not in PHP code

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

If this command is working fine on console but not working in PHP code then you need to look inside package code (service provider) where that command is registered. If its registered using

$this->app->runningInConsole()

then you need to remove that and try running it again. Hope this will work.

OR

You can add that command in Kernel yourself
Path: app/Console/Kernel.php

protected $commands = [
    \Package\Path\Console\CommandName::class,
];

Credit: https://laracasts.com/discuss/channels/general-discussion/artisan-command-from-package-not-recognized-when-calling-from-php

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading