0
我試圖在控制器中執行自定義Artisan命令,但它會拋出CommandNotFound
異常。在執行過程中,我運行命令,而不是執行整個命令'php artisan scan {url}',我只是運行scan {url},因爲這個答案:Running Artisan Command。我不明白我做錯了什麼?在Controller中調用自定義Artisan命令Laravel
定製工匠命令簽名
protected $signature = 'scan {url}
{--r= : y or n | to follow or not to follow the robot.txt}
{--fm= : set follow mode}
{--u= : username}
{--p= : password}
{--s : SQL module}
{--x : XSS module}';
實施
switch ($select) {
case 'full':
\Artisan::call('scan ' . $customer->cms_url); //url == http://localhost:8888
return $request;
break;
}
錯誤
1/1) CommandNotFoundException
There are no commands defined in the "scan http" namespace.
in Application.php (line 548)
at Application->findNamespace('scan http')
in Application.php (line 582)
at Application->find('scan http://localhost:8888')
in Application.php (line 205)
謝謝您的答覆。這是正確的解決方案。 – melkawakibi