samedi 28 décembre 2019

Laravel lost locale after login

I am very beginner in Laravel. I use Laravel 5.8 in my project. I have middleware in my project with code:

class Localization
{
    public function handle($request, Closure $next)
    {
        if (session()->has('locale')) {
            App::setLocale(session()->get('locale'));
        }
        return $next($request);
    }
}

I have translation file in:

  • resources/lang/de/messages.php

  • resources/lang/en/messages.php

  • resources/lang/pl/messages.php

When I login in my website I lost translation. I have the default language (Polish). How can you fix this?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/351bPM1
via IFTTT

Aucun commentaire:

Enregistrer un commentaire