PHPackages                             whilesmart/eloquent-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. whilesmart/eloquent-webhooks

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

whilesmart/eloquent-webhooks
============================

Webhook management package for Laravel applications

v1.0.0(4w ago)029[1 issues](https://github.com/whilesmartphp/eloquent-webhooks/issues)MITPHPPHP ^8.3CI passing

Since May 10Pushed 4w agoCompare

[ Source](https://github.com/whilesmartphp/eloquent-webhooks)[ Packagist](https://packagist.org/packages/whilesmart/eloquent-webhooks)[ RSS](/packages/whilesmart-eloquent-webhooks/feed)WikiDiscussions dev Synced 1w ago

READMEChangelog (1)Dependencies (13)Versions (5)Used By (0)

Eloquent Webhooks
=================

[](#eloquent-webhooks)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4720bbf07fc446d8ec282e2b2f140ec39b55a664fa7b58c6d4ab4310cdd54687/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7768696c65736d6172742f776562686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/whilesmart/webhooks)[![GitHub Tests Action Status](https://camo.githubusercontent.com/74b4f2af76edf4e75c9915838d75db3f4c4763c69687d5a06843a67d6129c4de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7768696c65736d6172742f656c6f7175656e742d776562686f6f6b732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/whilesmart/eloquent-webhooks/actions?query=workflow%3Atests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/efc904e7ce00bd40106e27feb90949854da8001ed06f8d6da6d290bcfe35f050/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7768696c65736d6172742f776562686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/whilesmart/webhooks)

A comprehensive webhook management package for Laravel applications. Easily manage, track, and process incoming webhooks with built-in support for workspace and project scoping.

Features
--------

[](#features)

- **Webhook Management:** Complete CRUD operations for webhooks.
- **Secure Ingress:** Automatic token generation for secure, unique webhook endpoints.
- **Event Tracking:** Logs all incoming webhook payloads, headers, and processing status.
- **Scoped by Default:** Built-in support for User, Workspace, and Project scoping.
- **Flexible Integration:** Seamlessly integrates with other WhileSmart packages like `eloquent-workspaces`, `projects`, and `activities`.
- **API Ready:** Comes with pre-configured controllers and routes for rapid development.

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

[](#installation)

You can install the package via composer:

```
composer require whilesmart/eloquent-webhooks
```

You should publish and run the migrations with:

```
php artisan vendor:publish --tag="webhooks-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="webhooks-config"
```

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Model Configuration
    |--------------------------------------------------------------------------
    */
    'user_model' => env('WEBHOOKS_USER_MODEL', 'App\\Models\\User'),
    'workspace_model' => env('WEBHOOKS_WORKSPACE_MODEL', 'App\\Models\\Workspace'),
    'project_model' => env('WEBHOOKS_PROJECT_MODEL', 'App\\Models\\Project'),

    /*
    |--------------------------------------------------------------------------
    | Route Configuration
    |--------------------------------------------------------------------------
    */
    'register_routes' => env('WEBHOOKS_REGISTER_ROUTES', true),
    'route_prefix' => env('WEBHOOKS_ROUTE_PREFIX', ''),
    'route_middleware' => ['auth:sanctum'],

    /*
    |--------------------------------------------------------------------------
    | Feature Flags
    |--------------------------------------------------------------------------
    */
    'workspace_scoped' => env('WEBHOOKS_WORKSPACE_SCOPED', true),
    'project_scoped' => env('WEBHOOKS_PROJECT_SCOPED', true),
    'track_events' => env('WEBHOOKS_TRACK_EVENTS', true),
];
```

Usage
-----

[](#usage)

### Managing Webhooks

[](#managing-webhooks)

The package provides a `Webhook` model that you can use to manage your webhooks.

```
use Whilesmart\Webhooks\Models\Webhook;

$webhook = Webhook::create([
    'name' => 'My Webhook',
    'user_id' => $user->id,
    'project_id' => $project->id,
    'workspace_id' => $workspace->id,
    'is_active' => true,
]);

// Get the unique ingress URL
echo $webhook->url; // https://your-app.com/webhooks/ingress/{token}
```

### Webhook Ingress

[](#webhook-ingress)

Incoming webhooks are sent to a unique URL containing a secure token. When a webhook is triggered:

1. The token is validated.
2. The `trigger_count` and `last_triggered_at` fields are updated.
3. A `WebhookEvent` is recorded containing the payload and headers.
4. If `whilesmart/activities` is installed, an activity log is automatically created.

### API Endpoints

[](#api-endpoints)

By default, the package registers the following routes (protected by `auth:sanctum`):

#### Management Routes

[](#management-routes)

- `GET /webhooks`: List all webhooks for the authenticated user.
- `POST /webhooks`: Create a new webhook.
- `GET /webhooks/{id}`: Get webhook details.
- `PATCH /webhooks/{id}`: Update a webhook (or regenerate its token).
- `DELETE /webhooks/{id}`: Soft delete a webhook.
- `GET /webhooks/{id}/events`: List event history for a webhook.

#### Workspace-Scoped Routes

[](#workspace-scoped-routes)

- `GET /workspaces/{workspaceId}/webhooks`
- `POST /workspaces/{workspaceId}/webhooks`
- ... (and other CRUD operations prefixed with workspace)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

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

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance94

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

28d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a1ca6f6e01ecbfe6640ff410c4f0321054fb48d05a5f843c2b89887b90369bcd?d=identicon)[whilesmart](/maintainers/whilesmart)

---

Top Contributors

[![kofimokome](https://avatars.githubusercontent.com/u/21100923?v=4)](https://github.com/kofimokome "kofimokome (10 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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