Answer the question
In order to leave comments, you need to log in
How to make route understand Laravel 5.2 language types?
Hello guys!
I
Look, when recovering a password, I send something like:
http://site.com/en/password/reset/db58caadfedf741b05[email protected]name.ru
http://site.com/ru/password/reset/db58caadfedf741b05[email protected]name.ru
Route::get('{locale}', function ($locale) {
$languages = ['ru','en'];
if (in_array($locale, $languages)){
Session::put('LANG', $locale);
return Redirect::back();
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question