From 6210aa78d1e61a27e3b38397ce6f683842b15954 Mon Sep 17 00:00:00 2001 From: Adam Campbell Date: Thu, 27 Oct 2022 16:59:53 -0500 Subject: [PATCH] Fix issue not dispatch sync handlers --- src/Providers/AbstractProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Providers/AbstractProvider.php b/src/Providers/AbstractProvider.php index c2d85c9..4dd614a 100644 --- a/src/Providers/AbstractProvider.php +++ b/src/Providers/AbstractProvider.php @@ -3,6 +3,7 @@ namespace Receiver\Providers; use Closure; +use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Support\Responsable; use Illuminate\Foundation\Bus\PendingDispatch; use Illuminate\Http\JsonResponse; @@ -160,7 +161,9 @@ protected function handle(): void if (class_exists($class)) { $instance = new $class($event, $this->webhook->getData(), $this->webhook); - $this->dispatched = dispatch($instance); + $this->dispatched = $instance instanceof ShouldQueue + ? dispatch($instance) + : dispatch_sync($instance); } }