You need to either use Artisan in your class, or you need to access it like this:
$exitCode = \Artisan::call(...
Hi all,
I have an issue when I try to call an artisan command from PHP through the Artisan::call() syntax. I want to implement this in one package and the command comes from another package, both are obviously used in the same app. When executing "php artisan" from the cmd, all looks good and the command is found, but not when calling like explained through PHP. Any idea on that?

EDIT: Sorry, I was not specific about the actual error. The error is something like "There were no commands found in the 'workflow' namespace." So I am definitely using Artisan Facade correctly, the issue must be deeper...
This question is related and I found a workaround by using exec()... Not a very nice way and I still would like to understand why Artisan::call() does not work with commands from packages, but at least it is working...
EDIT: Found the issue together with our Laravel consultant. In the package registering the console commands, I was using the if($this->app->runningInConsole()) check, of course it is only registered then if the app runs in console. By removing this constraint, the issue was fixed and Artisan::call() was able to find my command.
Please or to participate in this conversation.