How to change message languages dynamically in Laravel | Change localisation in Laravel

Create folders inside resources/lang for different different languages and write message files with same name and also write same key among all the message files.

like I have 2 languages EN and ES.. then I created 2 folders, one is en and second is es.

Inside both folders I created password files. like:

en/passwords.php

es/passwords.php

Now I can call any of these 2 language messages by their file and key name like:

here I can pass the language code dynamically in the constructor and message of that language will be called. ...  Read More

Share This: