Well you need some way to set the locale in the session. So you need to use a controller for that and simply set the session.
Documentation: https://laravel.com/docs/5.4/session#using-the-session
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I would like to know how to set locale in session.
my language picker isnt' input type, but just text. here is blade fragment - this is language picker:
<div class = "col-lg-5 col-md-5" id = "lang">
<ul id = "lang_menu">
<li class = "language active">Latviešu</a></li>
<li class = "language">Pусский</a></li>
<li class = "language">English</a></li>
</ul>
</div>
Here are routes:
Route::get('/', 'PagesController@index');
Route::get('/mafia', 'PagesController@mafia');
Route::get('/games', 'PagesController@games');
Route::get('/discounts', 'PagesController@discounts');
Route::get('/tournaments', 'PagesController@tournaments');
Route::get('/gallery', 'PagesController@gallery');
Route::get('/aboutus', 'PagesController@aboutus');
also i have transladet files who works fine when i changing locale in config
Please or to participate in this conversation.