diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 7a9425d72010..aafe25931921 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -64,22 +64,22 @@ class Handler extends ExceptionHandler if (app()->bound('sentry') && $this->shouldReport($exception)) { - // app('sentry')->configureScope(function (Scope $scope): void { + app('sentry')->configureScope(function (Scope $scope): void { - // if (auth()->guard('contact') && auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) { - // $scope->setUser([ - // 'id' => auth()->guard('contact')->user()->company->account->key, - // 'email' => "anonymous@example.com", - // 'name' => "Anonymous User", - // ]); - // } elseif (auth()->guard('user') && auth()->guard('user')->user() && auth()->user()->company() && auth()->user()->company()->account->report_errors) { - // $scope->setUser([ - // 'id' => auth()->user()->account->key, - // 'email' => "anonymous@example.com", - // 'name' => "Anonymous User", - // ]); - // } - // }); + if (auth()->guard('contact') && auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) { + $scope->setUser([ + 'id' => auth()->guard('contact')->user()->company->account->key, + 'email' => "anonymous@example.com", + 'name' => "Anonymous User", + ]); + } elseif (auth()->guard('user') && auth()->guard('user')->user() && auth()->user()->company() && auth()->user()->company()->account->report_errors) { + $scope->setUser([ + 'id' => auth()->user()->account->key, + 'email' => "anonymous@example.com", + 'name' => "Anonymous User", + ]); + } + }); app('sentry')->captureException($exception); } diff --git a/app/Jobs/Util/UploadFile.php b/app/Jobs/Util/UploadFile.php index ac9168e21b55..ce8d500dcd02 100644 --- a/app/Jobs/Util/UploadFile.php +++ b/app/Jobs/Util/UploadFile.php @@ -94,8 +94,8 @@ class UploadFile implements ShouldQueue $document->disk = $this->disk; $document->hash = $this->file->hashName(); $document->size = $this->file->getSize(); - $document->width = isset($width) ?? null; - $document->height = isset($height) ?? null; + $document->width = isset($width) ? $width : null; + $document->height = isset($height) ? $height : null; // $preview_path = $this->encodePrimaryKey($this->company->id); // $document->preview = $this->generatePreview($preview_path); diff --git a/app/Transformers/DocumentTransformer.php b/app/Transformers/DocumentTransformer.php index ca3435c58f30..6f34407b08e4 100644 --- a/app/Transformers/DocumentTransformer.php +++ b/app/Transformers/DocumentTransformer.php @@ -37,7 +37,7 @@ class DocumentTransformer extends EntityTransformer 'assigned_user_id' => $this->encodePrimaryKey($document->assigned_user_id), 'project_id' => $this->encodePrimaryKey($document->project_id), 'vendor_id' => $this->encodePrimaryKey($document->vendor_id), - 'url' => (string) $document->url ?: '', + 'url' => (string) $document->generateUrl() ?: '', 'preview' => (string) $document->preview ?: '', 'name' => (string) $document->name, 'type' => (string) $document->type,