remove config

This commit is contained in:
vedatakd 2021-07-28 15:11:34 +03:00
parent 8f15f20ab6
commit a33b5713fc
2 changed files with 11 additions and 15 deletions

View File

@ -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),
]
);

View File

@ -269,7 +269,4 @@ return [
],
'enable_sentry_laravel' => env('ENABLE_SENTRY_LARAVEL',true),
];