user()->id)->first(); $locale = 'en'; if (! in_array($userSetting->language, ['en', 'ru', 'est'])) { $locale = $userSetting->language; } Session::put('locale', $locale); app()->setLocale($locale); if (!empty($userSetting)) { $userSetting->update([ 'language' => $locale ]); } } return $next($request); } }