Fixes for handler

This commit is contained in:
David Bomba 2024-03-11 10:20:18 +11:00
parent abfe28371b
commit b7305a8538
2 changed files with 6 additions and 3 deletions

View File

@ -138,7 +138,7 @@ class Handler extends ExceptionHandler
'email' => 'anonymous@example.com', 'email' => 'anonymous@example.com',
'name' => 'Anonymous User', 'name' => 'Anonymous User',
]); ]);
} elseif (auth()->guard('user') && auth()->guard('user')->user() && auth()->user()->company() && auth()->user()->company()->account->report_errors) { } elseif (auth()->guard('user') && auth()->guard('user')->user() && auth()->user()->companyIsSet() && auth()->user()->company()->account->report_errors) {
$scope->setUser([ $scope->setUser([
'id' => auth()->user()->account->key, 'id' => auth()->user()->account->key,
'email' => 'anonymous@example.com', 'email' => 'anonymous@example.com',

View File

@ -311,8 +311,11 @@ class CompanyImport implements ShouldQueue
} }
} }
unlink($tmp_file); if(file_exists($tmp_file))
unlink(Storage::path($this->file_location)); unlink($tmp_file);
if(Storage::exists($this->file_location))
unlink(Storage::path($this->file_location));
} }
// //