所以我有如下所示的路由方案。当 URI 看起来像“ audi-a4-modification-category”时 - 它工作正常。但是当我有像“ alfa-romeo-giulietta-modification-category”这样的 uri 时,因为Laravel 认为 alfa - 品牌,romeo - 模型......而且我从控制器那里得到了错误的方法。如何在不更改 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');
catspeake
MMTTMM