Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Webiondev123's avatar

Set Locale for session

Hi. I am trying to set locale for the whole session when user clicks on the language type. But it is only working for current page where user clicks. When user goes to another page the default locale is set.

my set locale function

  public function french(){


      \App::setLocale('fr');//how to set it for whole session?
      return view('/welcome');
  }

works for current page only.

0 likes
2 replies
Webiondev123's avatar

Step 5 is not needed for me as language persists after page change without step 5...

1 like

Please or to participate in this conversation.