From e8c46a9aa3830dd09395911f6b058968af95593d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 5 Oct 2021 15:38:48 +0300 Subject: [PATCH] Deleted company check on middleware #rvwrev --- app/Http/Middleware/IdentifyCompany.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/IdentifyCompany.php b/app/Http/Middleware/IdentifyCompany.php index bb396ec47..e8c58de53 100644 --- a/app/Http/Middleware/IdentifyCompany.php +++ b/app/Http/Middleware/IdentifyCompany.php @@ -40,7 +40,13 @@ class IdentifyCompany } // Set company as current - company($company_id)->makeCurrent(); + $company = company($company_id); + + if (empty($company)) { + abort(500, 'Company not found'); + } + + $company->makeCurrent(); // Fix file/folder paths config(['filesystems.disks.' . config('filesystems.default') . '.url' => url('/' . $company_id) . '/uploads']);