where('title', $event)->where('type', $channel)->first(); if (empty($template)) { continue; } $notification = MessageReport::create([ 'title' => $event, 'channel' => $channel, 'business_id' => $businessId, 'template_id' => $template->id, 'message' => $template->message, ]); // Dispatch job SendNotificationJob::dispatch( data: $data, channel: $channel, template: $template, businessId: $businessId, notificationId: $notification->id, )->onQueue('high'); } return $array; } }