Answer the question
In order to leave comments, you need to log in
How to modify url with middleware in laravel 5?
Let's say the url /ru/path/to
is sent, the middleware detects /ru, does what it needs, and it's just /path/to that comes to the routes
Answer the question
In order to leave comments, you need to log in
You can use grouping together with an intermediary:
Route::group(['prefix' => App::getLocale(), 'middleware' => 'LanguageMiddleware'], function() {
Route::get('user', ['as' => 'user', 'uses' => '[email protected]']);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question