作为官方文档,它并没有太多提及。
App\Console\Commands\PullUsersCommand.php
的签名如下:
protected $signature = 'pull:users {startTime} {endTime} {minutes=10} {--flag} {--star=}';
因此,如何在App\Console\Kernel.php
中传递参数给它
答案 0 :(得分:0)
您可以像这样在App \ Console \ Kernel.php中调用它:
$schedule->command('pull:users', [
time(), // captured with $this->argument('startTime') in command class.
time(), // captured with $this->argument('endTime') in command class.
30, // captured with $this->argument('minutes') in command class.
'--flag',// should be without any value, just the option name, and would be captured by $this->option('minutes').
'--star'=>12, // would be captured by $this->option('star').
])->daily();
Artisan::call
外观也应该没问题。