I use 2 languages in my Laravel 5.2 application. There is a simple password reminder page that I am currently implementing, and for reasons unknown to me, I have problems sending an email for a new password in the correct language.
Say I see a page in German. In the page view, I echo 2 values using Facades:
echo App::getLocale();
echo Session::get('locale');
The page is in German, so both values are echo de.
Now I enter the email address in the form and submit it. The input goes to the controller method and calls the library to send the user a new password:
public function resetPassword() {
Mailer::sendNewPasswordEmail($user);
}
Finally, in the library, I var_dump the same 2 values, for example:
public static function sendNewPasswordEmail($user) {
var_dump(App::getLocale());
var_dump(Session::get('locale'));
die;
}
Session::get('locale') - de, App::getLocale() en.
, , ?
Blade @lang(). , , , . , , App::getLocale() POST, .
, , . , "" , , . .
?