PHPackages                             viezel/webhooks - 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. viezel/webhooks

ActiveLibrary

viezel/webhooks
===============

Webhooks for Laravel

1.0.0(5y ago)511MITPHPPHP ^7.4

Since Oct 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/viezel/webhooks)[ Packagist](https://packagist.org/packages/viezel/webhooks)[ Docs](https://github.com/viezel/webhooks)[ RSS](/packages/viezel-webhooks/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Webhooks for Laravel
====================

[](#webhooks-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8ed459312b90207fdacc8f7110c188904136891e2a40887f4700f79841037e64/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7669657a656c2f776562686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/viezel/webhooks)[![GitHub Tests Action Status](https://camo.githubusercontent.com/47781aad7b48e701ea35fc6268571ba6808e03862fdd316967909bb5cc49a27c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7669657a656c2f776562686f6f6b732f54657374733f6c6162656c3d7465737473)](https://github.com/viezel/webhooks/actions?query=workflow%3Arun-tests+branch%3Amaster)

Simple and powerful implementation of Webhooks.

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

[](#installation)

You can install the package via composer:

```
composer require viezel/webhooks
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="Viezel\Webhooks\WebhooksServiceProvider" --tag="migrations"
php artisan migrate
```

Add routes to your application. Below is a typical route configuration with auth, api prefix and naming.

```
Route::middleware('auth:api')->prefix('api')->as('webhooks.api.')->group(function() {
    Route::get('hooks', Viezel\Webhooks\Controllers\API\ListWebhooks::class)->name('list');
    Route::get('hooks/events', Viezel\Webhooks\Controllers\API\ListWebhookEvents::class)->name('events');
    Route::post('hooks', Viezel\Webhooks\Controllers\API\CreateWebhook::class)->name('create');
    Route::delete('hooks/{id}', Viezel\Webhooks\Controllers\API\DeleteWebhook::class)->name('delete');
});
```

Usage
-----

[](#usage)

First, register Events in your application that should be exposed as Webhooks. To do so, your Events should implement the `ShouldDeliverWebhooks` interface.

The interface has two methods, `getWebhookName` for giving the webhook a unique name, and `getWebhookPayload` to define the data send with the webhook.

The following example shows how a Post Updated Event and its implementation:

```
use App\Models\Post;
use Viezel\Webhooks\Contracts\ShouldDeliverWebhooks;

class PostUpdatedEvent implements ShouldDeliverWebhooks
{
    public function __construct(Post $post)
    {
        $this->post = $post;
    }

    public function getWebhookName(): string
    {
        return 'post:updated';
    }

    public function getWebhookPayload(): array
    {
        return [
            'post' => $this->post->toArray(),
            'extra' => [
                'foo' => 'bar'
            ]
        ];
    }
}
```

Next you need to register all your events with the `WebhookRegistry`. This is typically done in the boot method of a ServiceProvider.

```
public function boot()
{
    WebhookRegistry::listen(PostUpdatedEvent::class);
}
```

To check everything works as expected, go visit the webhooks events route. The default route is: `/api/hooks/events`. It depends how you register the webhook routes.

### List available webhooks events

[](#list-available-webhooks-events)

GET

### List registered webhooks

[](#list-registered-webhooks)

GET

### Register a webhook

[](#register-a-webhook)

POST

```
{
    "events": [
        "post:updated"
    ],
    "url": "https://another-app.com/some/callback/route"
}
```

### Delete a webhook

[](#delete-a-webhook)

DELETE [https://myapp.test/api/hooks/{id}](https://myapp.test/api/hooks/%7Bid%7D)

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Mads Møller](https://github.com/viezel)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2036d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e24155f0d3ab61799ca35477a940edce613075a20d1073f2241905271f29d23?d=identicon)[viezel](/maintainers/viezel)

---

Top Contributors

[![viezel](https://avatars.githubusercontent.com/u/312065?v=4)](https://github.com/viezel "viezel (7 commits)")

---

Tags

webhooks

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/viezel-webhooks/health.svg)

```
[![Health](https://phpackages.com/badges/viezel-webhooks/health.svg)](https://phpackages.com/packages/viezel-webhooks)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k84.2M225](/packages/laravel-horizon)[bref/laravel-bridge

An advanced Laravel integration for Bref, including Octane support.

3384.1M11](/packages/bref-laravel-bridge)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[illuminate/broadcasting

The Illuminate Broadcasting package.

7126.5M178](/packages/illuminate-broadcasting)[illuminate/notifications

The Illuminate Notifications package.

483.0M967](/packages/illuminate-notifications)[spatie/laravel-backup-server

Backup multiple applications

17016.7k1](/packages/spatie-laravel-backup-server)

PHPackages © 2026

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