Answer the question
In order to leave comments, you need to log in
How to use different controllers depending on the route parameter?
There is a route
Route::get('/{lang}/{unit}/{slug}', [
'as' => 'article', 'uses' => '[email protected]'
]);
Route::get('/{lang}/{unit}/contact', [
//
]);
Answer the question
In order to leave comments, you need to log in
You need to specify routes in order from hard to flexible, and not vice versa
Route::get('/{lang}/{unit}/contact', [
'as' => 'contact', 'uses' => '[email protected]'
]);
Route::get('/{lang}/{unit}/{slug}', [
'as' => 'article', 'uses' => '[email protected]'
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question