/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $domain = Request::getHost(); $locales = config('domains'); if (in_array($domain, $locales)) { App::setLocale(array_search(Request::getHost(), $locales)); } return $next($request); }