has('lang')) { $locale = $request->input('lang'); App::setLocale($locale); } elseif (auth()->guard('vendor')->user()) { App::setLocale(auth()->guard('vendor')->user()->company->locale()); } elseif (auth()->user()) { try{ App::setLocale(auth()->user()->company()->getLocale()); } catch(\Exception $e){ } } else { App::setLocale(config('ninja.i18n.locale')); } return $next($request); } }