From a33b5713fcdf884a48e99289622f96f5e7015dbf Mon Sep 17 00:00:00 2001 From: vedatakd Date: Wed, 28 Jul 2021 15:11:34 +0300 Subject: [PATCH] remove config --- app/Exceptions/ExceptionHandler.php | 23 +++++++++++------------ config/app.php | 3 --- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/app/Exceptions/ExceptionHandler.php b/app/Exceptions/ExceptionHandler.php index 3e939632e..f7522c175 100644 --- a/app/Exceptions/ExceptionHandler.php +++ b/app/Exceptions/ExceptionHandler.php @@ -53,10 +53,10 @@ class ExceptionHandler extends Handler $summary = $e->getMessage(); $headers = $e->getHeaders(); - $code = $e->getStatusCode(); - $name = trans("streams::error.{$code}.name"); + $code = $e->getStatusCode(); + $name = trans("streams::error.{$code}.name"); $message = trans("streams::error.{$code}.message"); - $id = $this->container->make(ExceptionIdentifier::class)->identify($this->original); + $id = $this->container->make(ExceptionIdentifier::class)->identify($this->original); if (view()->exists($view = "streams::errors/{$code}")) { return response()->view($view, compact('id', 'code', 'name', 'message', 'summary'), $code, $headers); @@ -72,12 +72,11 @@ class ExceptionHandler extends Handler public function report(Throwable $e) { - if (app()->bound('sentry') - && $this->shouldReport($e) - && env('SENTRY_LARAVEL_DSN')) { - if (config('app.enable_sentry_laravel')) { - app('sentry')->captureException($e); - } + if (app()->bound('sentry') && + $this->shouldReport($e) && + env('SENTRY_LARAVEL_DSN') && + !empty(env('SENTRY_LARAVEL_DSN'))) { + app('sentry')->captureException($e); } if ($e instanceof Swift_TransportException) { @@ -92,9 +91,9 @@ class ExceptionHandler extends Handler try { return array_filter( [ - 'user' => Auth::id(), - 'email' => Auth::user() ? Auth::user()->email : null, - 'url' => request() ? request()->fullUrl() : null, + 'user' => Auth::id(), + 'email' => Auth::user() ? Auth::user()->email : null, + 'url' => request() ? request()->fullUrl() : null, 'identifier' => $this->container->make(ExceptionIdentifier::class)->identify($this->original), ] ); diff --git a/config/app.php b/config/app.php index 40b4bf058..c8c483477 100644 --- a/config/app.php +++ b/config/app.php @@ -269,7 +269,4 @@ return [ ], - - 'enable_sentry_laravel' => env('ENABLE_SENTRY_LARAVEL',true), - ];