Issue
I need to check if a Laravel Console Command exists and if it is in the protected command var to call them.
I need to call them from another Laravel console command. And I want to know if there are something like exists_command('mycommand:foo')
There are any way to achieve this?
Solution
Tested and working.
function command_exists($name)
{
return array_has(\Artisan::all(), $name);
}
if (command_exists('config:cache')) {
// success
}
Answered By - Sandeesh Answer Checked By - Marie Seifert (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.