Level 104
I don't believe there is a solution for this except alfa-romeo becoming either alfa_romeo or alfaromeo, anything else will result in a mismatched route.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey guys. I have a problem with custom routing. So I have routes scheme like below, and it's works fine when uri is like "audi-a4-modification-category", but when uri is like "alfa-romeo-giulietta-modification-category" I'm getting wrong controller method, because laravel thinking alfa - brand, romeo - model etc... How can I fix that without changing delimiter in uri
Route::get('{brand}-{model}-{modification}-{category}', 'Frontend\PagesController@category')->middleware('custom-routing')->name('frontend.category');
Route::get('{brand}-{model}-{modification}', 'Frontend\PagesController@modification')->middleware('custom-routing')->name('frontend.modification');
Route::get('{brand}-{model}', 'Frontend\PagesController@model')->middleware('custom-routing')->name('frontend.model');
Route::get('{brand}', 'Frontend\PagesController@brand')->middleware('custom-routing')->name('frontend.brand');
Please or to participate in this conversation.