In the command, you add getArguments ():
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'), ); }
You can use the arguments:
$fdmprinterpath = $this->argument('fdmprinterpath'); $configpath = $this->argument('configpath'); $gcodepath = $this->argument('gcodepath'); $tempstlpath = $this->argument('tempstlpath'); $uid = $this->argument('uid');
call the command with parameters:
Artisan::call('command:slice-model', ['fdmprinterpath' => $fdmprinterpath, 'configpath' => $configpath, 'gcodepath' => $gcodepath, 'tempstlpath' => $tempstlpath]);
See the article for more information.
source share