$payload */ public function dispatch(string $event, array $payload, int $workspaceId): void { Webhook::where('workspace_id', $workspaceId) ->where('is_active', true) ->whereJsonContains('events', $event) ->each(function (Webhook $webhook) use ($event, $payload) { DeliverWebhookJob::dispatch($webhook, $event, $payload) ->onQueue('default'); }); } }