Removed the use of Auth facade and removed unnecesary option

This commit is contained in:
stanjg 2018-06-01 16:10:32 +02:00
parent 3bb9e5e8a8
commit e9ac014bf4
No known key found for this signature in database
GPG key ID: 27D9DF9D28935303
3 changed files with 1 additions and 8 deletions

View file

@ -48,11 +48,7 @@ class LanguageMiddleware
*/
public function handle(Request $request, Closure $next)
{
if (! Auth::check() || $this->config->get('pterodactyl.lang.global')) {
$this->app->setLocale($this->config->get('app.locale', 'en'));
} else {
$this->app->setLocale(Auth::user()->language);
}
$this->app->setLocale($request->user()->language ?? $this->config->get('app.locale'));
return $next($request);
}