From 094d38f82ce03a363b00bf300dedb5af93d33215 Mon Sep 17 00:00:00 2001 From: yaozm Date: Sat, 5 Aug 2023 00:59:34 +0800 Subject: [PATCH] fix(ExceptionNotifyManager): Fix queue connection config key - Change `config('exception-notify.queue_connection')` to `config('exception-notify.queue.connection')` --- src/ExceptionNotifyManager.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ExceptionNotifyManager.php b/src/ExceptionNotifyManager.php index 83a6223..4fb3681 100644 --- a/src/ExceptionNotifyManager.php +++ b/src/ExceptionNotifyManager.php @@ -33,6 +33,7 @@ use Guanguans\Notify\Factory; use Illuminate\Cache\RateLimiter; use Illuminate\Contracts\Container\BindingResolutionException; +use Illuminate\Support\Arr; use Illuminate\Support\Manager; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; @@ -89,7 +90,7 @@ public function report(\Throwable $throwable, $channels = null): void if ( ! $this->container->runningInConsole() - && 'sync' === config('exception-notify.queue_connection') + && 'sync' === config('exception-notify.queue.connection') && method_exists($dispatch, 'afterResponse') ) { $dispatch->afterResponse(); @@ -114,10 +115,8 @@ public function shouldntReport(\Throwable $throwable): bool return true; } - foreach (config('exception-notify.except') as $type) { - if ($throwable instanceof $type) { - return true; - } + if (Arr::first(config('exception-notify.except'), static fn (string $type): bool => $throwable instanceof $type)) { + return true; } return ! $this