guard('contact')->check()) { auth()->guard('contact')->logout(); $request->session()->invalidate(); } /*LOCALE SET */ if ($request->has('lang') && in_array($request->input('lang','en'), $this->locales) ) { $locale = $request->input('lang'); App::setLocale($locale); } elseif (auth()->guard('vendor')->user()) { App::setLocale(auth()->guard('vendor')->user()->vendor->locale()); } elseif (auth()->user()) { try { App::setLocale(auth()->user()->company()->getLocale()); } catch (\Exception $e) { } } else { App::setLocale(config('ninja.i18n.locale')); } return $next($request); } }