在你指挥你添加getArguments():
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
array('fdmprinterpath', InputArgument::REQUIRED, 'Basic slice config path'),
array('configpath', InputArgument::REQUIRED, 'User slice config path'),
array('gcodepath', InputArgument::REQUIRED, 'Path for the generated gcode'),
array('tempstlpath', InputArgument::REQUIRED, 'Path for the model that will be sliced'),
array('uid', InputArgument::REQUIRED, 'User id'),
);
}
您可以使用参数:
$fdmprinterpath = $this->argument('fdmprinterpath');
$configpath = $this->argument('configpath');
$gcodepath = $this->argument('gcodepath');
$tempstlpath = $this->argument('tempstlpath');
$uid = $this->argument('uid');
叫你命令参数:
Artisan::call('command:slice-model', ['fdmprinterpath' => $fdmprinterpath, 'configpath' => $configpath, 'gcodepath' => $gcodepath, 'tempstlpath' => $tempstlpath]);
对于更多信息请参考此article。
你是对的 - 我的意思是迁移:make - 但问题是关于一般的工匠命令。感谢您的回答。 – GuruBob 2014-10-02 11:18:02