make:command生成的文件中有两个默认方法getArguments和getOptions有什么作用?
使用php artisan make:command 命令生成的文件有两个默认方法。getArguments 和getOptions,请问这两个方法有什么作用啊?
/**
* Get the console command arguments.
*/
protected function getArguments(): array
{
return [
['example', InputArgument::REQUIRED, 'An example argument.'],
];
}
/**
* Get the console command options.
*/
protected function getOptions(): array
{
return [
['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null],
];
}
推荐文章: