mardi 10 octobre 2017

Laravel command - Only optional argument

I have a command with this signature

order:check {--order}

And execute this:

php artisan order:check --order 7

For some reason that results in this exception

  [RuntimeException]                                 
  Too many arguments, expected arguments "command".  

Why? I want that this command can either be executed as php artisan order:check or with an optional order id php artisan order:check --order X



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire