Skip to content

Commit

Permalink
Deleted company check on middleware #rvwrev
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Oct 5, 2021
1 parent a3eccce commit e8c46a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Http/Middleware/IdentifyCompany.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ public function handle($request, Closure $next, ...$guards)
}

// 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']);
Expand Down

0 comments on commit e8c46a9

Please sign in to comment.