根据官方文档,它并没有详细说明这个问题。
App\Console\Commands\PullUsersCommand.php
的签名如下:
protected $signature = 'pull:users {startTime} {endTime} {minutes=10} {--flag} {--star=}';
因此,如何将参数传递给在
App\Console\Kernel.php
中的命令呢?根据官方文档,它并没有详细说明这个问题。
App\Console\Commands\PullUsersCommand.php
的签名如下:
protected $signature = 'pull:users {startTime} {endTime} {minutes=10} {--flag} {--star=}';
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
门面应该也可以。