Created
January 10, 2017 12:32
-
-
Save escuccim/da27655b26e5128165d44379f1b7e608 to your computer and use it in GitHub Desktop.
Laravel Helper to set language from session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setLanguage(){ | |
// set the app locale | |
App::setLocale( session('locale') ? session('locale') : config('app.locale')); | |
// set PHP locale for formatting dates | |
if(App::getLocale() == 'fr') | |
setlocale(LC_TIME, 'fr_CH.UTF-8'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment