Answer the question
In order to leave comments, you need to log in
In Laravel 6, how to add a language prefix to Route:: with default language support?
Writing:
Route::pattern('locale', '(?:/|/en|/ru)');
Route::get('{locale}', '[email protected]');
Route::get('{locale}/page', '[email protected]');
php artisan route:cache
Answer the question
In order to leave comments, you need to log in
today, by some miracle, with a tambourine and such and such a mother figured out
Route::pattern('locale', '|ru/|en/');
Route::get('{locale}route', 'action');
// /(?P<locale>(?:|en/|ru/))route
Route::get('{locale?}/page', '[email protected]')->where(['locale' => '^[a-z][a-z]$']);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question