From bee623af758a6e701d4ee32ea49e825fc35698c7 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 16 Jan 2022 19:09:46 +1100 Subject: [PATCH] Fixes for locale middleware --- app/Http/Middleware/Locale.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/Locale.php b/app/Http/Middleware/Locale.php index e8c9e4e148..d9f5513b8f 100644 --- a/app/Http/Middleware/Locale.php +++ b/app/Http/Middleware/Locale.php @@ -35,7 +35,13 @@ class Locale } elseif (auth('contact')->user()) { App::setLocale(auth('contact')->user()->client->locale()); } elseif (auth()->user()) { - App::setLocale(auth()->user()->company()->getLocale()); + + try{ + App::setLocale(auth()->user()->company()->getLocale()); + } + catch(\Exception $e){ + } + } else { App::setLocale(config('ninja.i18n.locale')); }