webspilka
245
23
Laravel

Optional router params

Posted 3 months ago by webspilka

hi I have next problem

Route::get('cars/{yearDelimiter?}/{year?}/{priceDelimiter?}/{price?}', 'Cars\[email protected]')
->where('yearDelimiter', 'year')
->where('priceDelimiter', 'price');

/api/cars/year/2013-2018/price/10000-100000 - works

/api/cars/year/2013-2018/ - works

but:

api/cars/price/10000-200000/ - 404 error

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.