作为官方的文档,它并没有提到关于这个很多。 App\Console\Commands\PullUsersCommand.php
具有类似特征:
protected $signature = 'pull:users {startTime} {endTime} {minutes=10} {--flag} {--star=}';
那么,如何将参数传递给它App\Console\Kernel.php
你可以把它在应用程序\控制台\ 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
门面了。