[英]Laravel's Artisan::call() doesn't work with flag parameters
我的命令在命令行上運行時有效:
php artisan my:command --theFlag
但是當我嘗試在代碼中使用它時:
Artisan::call("my:command --theFlag");
Laravel找不到我的命令:
Exception : The command "my:command --theFlag" does not exists
好的,我發現了:我猜我的Laravel有點舊了,不支持這種語法。
這有效:
Artisan::call("my:command", [
"--theFlag" => true
]);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.