After searching through the documentation from laraval 4 I see that the way to set a language is to do
App::setLocale('en');
But how do I use this in combination with for example a language switcher on my website that a visitor can click on to change the language on the fly? and to remember this with a cookie or something?
It seems that in laravel 3 it was much easier but since im new to laravel I don't know how to figure this out so if someone knows what to do and can help me out it would be great :)
This is a way:
Create a route for your language selector:
Create your language selectors links in Laravel Blade's view:
A Controller:
Then in your app/start/global.php you can:
There is great library for Laravel that allows you to handle locales flexible - mcamara laravel localization. In readme of the project you can find example how to implement such a switcher.