samedi 12 octobre 2019

Laravel: how to set string as optional in route?

in web.php I have:

Route::get('car/id/{id}/color/{color?}', 'carController@getCar);

But I want the whole part of /color/{color?} to be optional not just the color parameter /{color?}, would you please tell me how to do this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire