PHPackages                             custom-d/webhook-registry - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. custom-d/webhook-registry

ActiveLibrary[API Development](/categories/api)

custom-d/webhook-registry
=========================

A webhook registry to manage webhooks in laravel projects

v1.0.0(2y ago)03.3k1MITPHPPHP ^8.1CI failing

Since Sep 30Pushed 2y ago6 watchersCompare

[ Source](https://github.com/customd/cd-webhook-registry)[ Packagist](https://packagist.org/packages/custom-d/webhook-registry)[ RSS](/packages/custom-d-webhook-registry/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (9)Dependencies (4)Versions (12)Used By (0)

Webhook Registry
================

[](#webhook-registry)

[![Build Status](https://camo.githubusercontent.com/b9dc4b7f050307d31f77354ebd90be019fac9924535660f1929c797596f306a0/68747470733a2f2f7472617669732d63692e6f72672f637573746f6d2d642f776562686f6f6b2d72656769737472792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/custom-d/webhook-registry)[![styleci](https://camo.githubusercontent.com/4499ec3a0efa386c7581f730bb44592bf518dc156779fc92c663dd51908cfb92/68747470733a2f2f7374796c6563692e696f2f7265706f732f4348414e47454d452f736869656c64)](https://styleci.io/repos/CHANGEME)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0874d01cec554bcc2ec01678c3705b38cb73ee7e291ffa10181d9dd35c6ffeb8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f637573746f6d2d642f776562686f6f6b2d72656769737472792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/custom-d/webhook-registry/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/eed2863b983f7ba4403c00c67aa213ff0fc1f6f07624d603255c231d3beff577/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f4348414e47454d452f6d696e692e706e67)](https://insight.sensiolabs.com/projects/CHANGEME)[![Coverage Status](https://camo.githubusercontent.com/33a58cf1cf3e98709e8b2a4a01c2d6337fd6419fce114c76a63454d40a72ac38/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f637573746f6d2d642f776562686f6f6b2d72656769737472792f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/custom-d/webhook-registry?branch=master)

[![Packagist](https://camo.githubusercontent.com/45dd7f555223d3162974c94c7415737035c90d56193c37259ac1ca5d852106ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f637573746f6d2d642f776562686f6f6b2d72656769737472792e737667)](https://packagist.org/packages/custom-d/webhook-registry)[![Packagist](https://camo.githubusercontent.com/941a27b72b53135d68ea19589fdb563a5aca1d68b1eeb1a601199d6282b259b7/68747470733a2f2f706f7365722e707567782e6f72672f637573746f6d2d642f776562686f6f6b2d72656769737472792f642f746f74616c2e737667)](https://packagist.org/packages/custom-d/webhook-registry)[![Packagist](https://camo.githubusercontent.com/2414ce872c4f61ec902d3e2c0b970229bbf5ef6f34db1466e5a7e4d903a1804f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f637573746f6d2d642f776562686f6f6b2d72656769737472792e737667)](https://packagist.org/packages/custom-d/webhook-registry)

A wrapper for [spatie/laravel-webhook-server](https://github.com/spatie/laravel-webhook-server) that provides a simple &amp; flexible webhook registry, allows you to expose any Laravel Event as a webhook, and provides out-of-the-box logging of webhook results.

Installation
------------

[](#installation)

Install via composer

```
composer require custom-d/webhook-registry
```

### Publish Configuration File

[](#publish-configuration-file)

```
php artisan vendor:publish --provider="CustomD\WebhookRegistry\ServiceProvider" --tag="config"
```

Usage
-----

[](#usage)

### 1. Trigger registered webhooks via events

[](#1-trigger-registered-webhooks-via-events)

Implement the `CustomD\WebhookRegistry\Contracts\ShouldDeliverWebhooks` contract on any Laravel Event, and you'll be able to register webhooks that will be fired on this event.

This contract defines several methods that need to be defined on your event, which will help provide the payload details.

MethodPurpose`getWebhookPayload`Returns the payload to send to the Spatie Webhook call. Useful if you want to completely override the payload.`getWebhookContext`Returns the payload `context` field. Useful if you want to set a different property. Defaults to returning the `->context` property from the event. If this property is `Arrayable`, we'll call `->toArray()`. You can overload this method on your event if you want to customise this behaviour.`getWebhookEventName`Returns the event name you want to expose in the payload. Useful for endpoints who recieve multiple different types of event to determine how to handle calls. By default, this is the value of the `->webhookEventName` property from the event, otherwise we fall back to the event class name.`shouldDeliverWebhook`Whether to deliver webhooks for this event. Defaults to true.Your payload must define a `body`, but can also define [tags](https://github.com/spatie/laravel-webhook-server#adding-tags) and [meta](https://github.com/spatie/laravel-webhook-server#adding-meta-information) information for passing to `Spatie\WebhookServer\WebhookCall`.

```
    /**
     * Get the payload for this webhook event
     */
    public function getWebhookPayload(): array
    {
        return [
            'body' => [
                'status' => $this->status,
            ]
        ];
    }
```

### 2. Register webooks

[](#2-register-webooks)

Create webhook endpoints direction using the `CustomD\WebhookRegistry\Models\WebhookEndpoint` model, or use the facade `WebhookRegistry::registerEndpoint`.

```
$endpoint = WebhookRegistry::registerEndpoint(
  'https://webhook.site/custom/endpoint',
  'My webhook endpoint name'
);
```

By default, we'll verify SSL certificates on outgoing webhook connections. If you want to disable SSL verification, you can pass `false` to the `registerEndpoint` function.

```
$endpoint = WebhookRegistry::registerEndpoint(
  'https://localhost/webhook-test',
  'My insecure endpoint',
  false
);
```

### 3. Bind events to an endpoint

[](#3-bind-events-to-an-endpoint)

Associate a webhook event to an endpoint with the `CustomD\WebhookRegistry\Model\WebhookEvent` model, or using the facade `WebhookRegistry::registerEvent`.

```
$event = WebhookRegistry::registerEvent($webhook->id, 'App\Events\MyEvent');

```

Models
------

[](#models)

Customise the WebhookEvent model in order to add logic about when events should fire. In `config/webhook-registry.php` you will see the models being used in `models` -&gt; `events`. You can make your own models by implementing the appropriate contract, and updating the config file.

```
WebhookEndpoint extends Model implements CustomD\WebhookRegistry\Models\Contracts\WebhookEndpointContract
WebhookEvent extends Model implements CustomD\WebhookRegistry\Models\Contracts\WebhookEventContract

```

If you need to modify the `WebhookRequest` logging table, note that it doesn't need a contract and can be overridden as needed, but ensure the original fields exist, or define appropriate attribute mappings.

### Custom 'dispatchable' logic

[](#custom-dispatchable-logic)

To determine which events are dispatchable in a given execution, you must set a `scopeWhereDispatchable` on the `WebhookEvent` model. This scope will be used when finding events that should be fired.

By default this scope doesn't do any filtering.

Security
--------

[](#security)

If you discover any security related issues, please email instead of using the issue tracker.

Credits
-------

[](#credits)

- [](https://github.com/custom-d/webhook-registry)
- [All contributors](https://github.com/custom-d/webhook-registry/graphs/contributors)

This package is bootstrapped with the help of [melihovv/laravel-package-generator](https://github.com/melihovv/laravel-package-generator).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 63% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~136 days

Recently: every ~152 days

Total

10

Last Release

832d ago

Major Versions

v0.9.2 → v1.0.02024-02-07

PHP version history (3 changes)0.5.0PHP &gt;=7.2

v0.7.0PHP ^8.0

v1.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1369970?v=4)[Custom D](/maintainers/customd)[@customd](https://github.com/customd)

---

Top Contributors

[![samatcd](https://avatars.githubusercontent.com/u/1476991?v=4)](https://github.com/samatcd "samatcd (17 commits)")[![craigAtCD](https://avatars.githubusercontent.com/u/152445143?v=4)](https://github.com/craigAtCD "craigAtCD (5 commits)")[![phpsa](https://avatars.githubusercontent.com/u/952595?v=4)](https://github.com/phpsa "phpsa (4 commits)")[![JituSSingh](https://avatars.githubusercontent.com/u/77375648?v=4)](https://github.com/JituSSingh "JituSSingh (1 commits)")

---

Tags

webhookregistry

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/custom-d-webhook-registry/health.svg)

```
[![Health](https://phpackages.com/badges/custom-d-webhook-registry/health.svg)](https://phpackages.com/packages/custom-d-webhook-registry)
```

###  Alternatives

[kyon147/laravel-shopify

Shopify package for Laravel to aide in app development

473252.9k](/packages/kyon147-laravel-shopify)[mpociot/captainhook

Add webhooks to your Laravel app.

3358.9k](/packages/mpociot-captainhook)[kayedspace/laravel-n8n

A complete, expressive, and fluent Laravel client for the n8n public REST API and Webhooks Triggering.

1376.2k1](/packages/kayedspace-laravel-n8n)[stymiee/authnetjson

Library that abstracts Authorize.Net's JSON APIs. This includes the Advanced Integration Method (AIM), Automated Recurring Billing (ARB), Customer Information Manager (CIM), Transaction Reporting, Simple Integration Method (SIM), and Webhooks.

19545.7k](/packages/stymiee-authnetjson)[jouwweb/sendcloud

Provides a client to interact with the Sendcloud API in an object-oriented way.

16256.9k1](/packages/jouwweb-sendcloud)[tapp/filament-webhook-client

Add a Filament resource and a policy for Spatie Webhook client

1120.2k](/packages/tapp-filament-webhook-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
