Custom Webhook Events

Register custom webhook events in config/custom.php so they appear in the webhook configuration UI. Users can then subscribe to these events and receive payloads at their configured endpoints.

Registering Events

Add entries to the webhook_events array in config/custom.php:

// config/custom.php

'webhook_events' => [
    'project.created' => [
        'group'       => 'Projects',
        'description' => 'A new project was created',
    ],
    'project.status_changed' => [
        'group'       => 'Projects',
        'description' => 'A project status was updated',
    ],
    'comment.added' => [
        'group'       => 'Projects',
        'description' => 'A comment was added to a project',
    ],
],

Event Properties

  • group — Groups related events in the webhook UI (e.g., all project events under "Projects")
  • description — Human-readable description shown in the UI

Where Events Appear

Registered events automatically show up in the webhook management UI, grouped by the group field. Users can subscribe to individual events when creating or editing a webhook endpoint.

Dispatching Events

Use WebhookDispatcher::dispatch() in your controllers or services to fire a webhook event:

use App\Services\WebhookDispatcher;

// After creating a project
WebhookDispatcher::dispatch($org->id, 'project.created', [
    'project_id' => $project->id,
    'name'       => $project->name,
    'status'     => $project->status,
    'created_by' => $request->user()->id,
]);

// After a status change
WebhookDispatcher::dispatch($org->id, 'project.status_changed', [
    'project_id' => $project->id,
    'name'       => $project->name,
    'old_status' => $oldStatus,
    'new_status' => $newStatus,
    'changed_by' => $request->user()->id,
]);

Parameters

  • $orgId — The organization ID (determines which webhook endpoints receive the event)
  • 'event.name' — Must match a key in your webhook_events config
  • [...] — Arbitrary payload data delivered as JSON to the subscriber's endpoint

Webhook Delivery

Webhook payloads are delivered asynchronously via Laravel's queue system. Each delivery includes a signature header for verification. Failed deliveries are retried automatically.