Closed JeanCarloLeal closed 6 years ago
@qschmick would you like to take a look at this. I would appreciate it.
@roshangautam Sure thing.
@JeanCarloLeal Can you add the --
before each of your arguments. E.g. --seaport=15
?
@qschmick I have not tested creating my command with --options, I believe this works. But using multiple arguments we've found the problem quoted.
@JeanCarloLeal thanks for the follow up. For clarification, you are passing the values seaport=15
as the argument to your command or are you declaring seaport
=> 15
? Would you be able to share your commands signature (obviously redacted as needed)? Thank you in advance for the help.
protected function getArguments()
{
return [
['seaport', InputArgument::REQUIRED, 'Código com os portos separados por virgula.'],
['typeTraffic', InputArgument::REQUIRED, 'Tipo de trafico separado por virgula.'],
['limit', InputArgument::OPTIONAL, 'Limit default 5000'],
['date', InputArgument::OPTIONAL, 'No formato \'Y-m-d\', Default -1'],
];
}
In totem Usage: seaport=15 typeTraffic=05 Console Usage: php artisan ce:generate 15 05
@JeanCarloLeal Just merged in a fix for this issue.
Ty
@qschmick I was updating my project and had a surprise, I'm using v2.1.
And your fix was for v2.0, can you check?
composer require studio/laravel-totem Using version ^2.1 for studio/laravel-totem
Its probably because its not been tagged yet.
@JeanCarloLeal Just tagged v2.2
Creating at new task: in the field "PARAMETERS (OPTIONAL)" I insert the following information for a custom command that can accept multiple arguments: "seaport=15 typetraffic=05" When i click Execute (to force execution) it works, because it don't use the console. However, when using the console (Laravel's schedule), it errors. I took the liberty to debug the code and found a problem in the file Task.php, method compileParameters. The problem happens because when running on console it doesn't pass named parameters, and in the mentioned method it will override the first parameter with the second as both will have the key 0. Following is a Print of a fix.
Please inform me if there is another solution.