umefarooq
92
0
Tips

[New Update] Example on how to use multiple locales in your Laravel 5 website

Posted 3 years ago by umefarooq

Hi, just added some more functionality to the script, right now this script adding locales all routes, if you want to skip locales for some routes like admin or private i have created pull request for this here is link for pull request

https://github.com/Marwelln/laravel-multiple-locales/pull/4

How you can skip locales

First Step

download my repo code, if my request is not pulled in original repo.

https://github.com/umefarooq/laravel-multiple-locales

2nd Step

open config/app.php find skip_locales or add config than add first segment of url you want to skip like following

 'skip_locales' => ['admin','other'] 

now you can call URL with and without locales

www.yoursite.com/admin //without locale

and 

www.yoursite.com/en/page-slug //with locale

All credit gose to @Marwelln author of this code here is link for original post

https://laracasts.com/discuss/channels/tips/example-on-how-to-use-multiple-locales-in-your-laravel-5-website?page=1

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.