Create your laravel project in multi language

611 0 0 0

Last Updated : 2024-02-22 13:38:11

In this snippet I will teach you how to make your laravel project multi language

Hello guys, 


In this snippet I will teach you how to make your laravel project multi language.


The whole idea of this method is to access session and put locale in session with value of the language you want. and make a middleware to check if session has locale value and then change the app locale based on the session locale value, and this middleware will be applied on all web routes. So let's get started in details 


1- go to config/app then add the following array like this


'languages' => [
'ar' => '???

Mahmoud Anwar

Mahmoud Anwar

Back End Developer with a passion for developing innovative web applications that expedite the efficiency and effectiveness of organizational success. Well-versed in technology and writing code to create systems that are reliable and user-friendly. Also has the proven ability to motivate, educate, and collaborate effectively to build web applications and effectively track changes. Confident communicator, strategic thinker, and innovative creator to develop software that is customized to meet a company’s organizational needs, highlight their core competencies, and further their success.