Suppose I have page for searching cars, page takes 3 optional parameters, brand
, year
and color
Simplified route example:
Route::get('/cars/{brand?}/{year?}/{color?}', function ($brand = NULL, $year = NULL, $color = NULL) {
echo "brand is:".$brand."<br>";
echo "year is:".$year."<br>";
echo "color is:".$color."<br>";
});
I don't realise how to pass for example only year
parameter?
Works if passed all of 3 parameters, for example: /cars/_/2010/_
but this is very inelegant solution.
What is proper way for this ?