PHPackages                             brentnd/laravel-sparkposthooks - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. brentnd/laravel-sparkposthooks

AbandonedArchivedLibrary[Mail &amp; Notifications](/categories/mail)

brentnd/laravel-sparkposthooks
==============================

A simple SparkPost webhook controller to help with events. Compatible with Laravel 5+ and Lumen 5+.

v1.0.0(7y ago)32.2kMITPHPPHP &gt;=5.5.9

Since May 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/brentnd/laravel-sparkposthooks)[ Packagist](https://packagist.org/packages/brentnd/laravel-sparkposthooks)[ RSS](/packages/brentnd-laravel-sparkposthooks/feed)WikiDiscussions develop Synced yesterday

READMEChangelogDependencies (2)Versions (3)Used By (0)

Laravel 5 / Lumen 5 SparkPost Webhook Controller
================================================

[](#laravel-5--lumen-5-sparkpost-webhook-controller)

[![Latest Version](https://camo.githubusercontent.com/a9fa8a7fae88af40614e61133ea28d00f2778d7f5abbed60c1b74363b6ac1f9e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6272656e746e642f6c61726176656c2d737061726b706f7374686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://github.com/brentnd/laravel-sparkposthooks/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/d86ce59bf19a9af1b185b167607bd9885cc4ac6df2c3fea7e1f7e715491b66c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6272656e746e642f6c61726176656c2d737061726b706f7374686f6f6b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/brentnd/laravel-sparkposthooks)

A simple SparkPost webhook controller to help with email events. Useful for notifying users that you cannot reach them via email inside your application. Compatible with Laravel 5+ and Lumen 5+.

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

[](#installation)

`composer require brentnd/laravel-sparkposthooks`

Basic Usage
-----------

[](#basic-usage)

1. Create a controller that extends SparkPostWebhookController as follows. You can then handle any SparkPost webhook event.

```
use Brentnd\Api\Webhooks\SparkPostWebhookController;

class MySparkPostController extends SparkPostWebhookController {

    /**
     * Handle a bounced email
     *
     * @param $payload
     */
    public function handleMessageEventBounce($payload)
    {
        $email = $payload['rcpt_to'];
    }

    /**
     * Handle a rejected email
     *
     * @param $payload
     */
    public function handleMessageEventPolicyRejection($payload)
    {
        $email = $payload['rcpt_to'];
    }

    /**
     * Handle an email open
     *
     * @param $payload
     */
    public function handleTrackEventOpen($payload)
    {
        $transmissionId = $payload['transmission_id'];
    }
}
```

2. Create the route to handle the webhook. In your routes.php file add the following.

```
post('sparkpost-webhook', ['as' => 'sparkpost.webhook', 'uses' => 'MySparkPostController@handleWebhook']);
```

3. [Exclude your route from CSRF protection](https://laravel.com/docs/5.4/csrf#csrf-excluding-uris) so it will not fail.
4. Make sure you add your webhook in SparkPost to point to your route. You can do this here:

Webhook Events
--------------

[](#webhook-events)

[Webhook event types](https://www.sparkpost.com/docs/tech-resources/webhook-event-reference/#event-types):

Common events and their handlers. For other events, just follow the same pattern.

Event typeEventMethodPing-handlePing()Message EventsBouncehandleMessageEventBounce()Message EventsDeliveryhandleMessageEventDelivery()Message EventsInjectionhandleMessageEventInjection()Message EventsPolicy RejectionhandleMessageEventPolicyRejection()Message EventsDelayhandleMessageEventDelay()Engagement EventsClickhandleTrackEventClick()Engagement EventsOpenhandleTrackEventOpen()Engagement EventsInitial OpenhandleTrackEventInitialOpen()Unsubscribe EventsList UnsubscribehandleUnsubscribeEventListUnsubscribe()Unsubscribe EventsLink UnsubscribehandleUnsubscribeEventLinkUnsubscribe()Contributors
------------

[](#contributors)

Based on [eventhomes/laravel-mandrillhooks](https://github.com/eventhomes/laravel-mandrillhooks)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

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

2910d ago

### Community

Maintainers

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

---

Top Contributors

[![lostincode](https://avatars.githubusercontent.com/u/565885?v=4)](https://github.com/lostincode "lostincode (44 commits)")[![brentnd](https://avatars.githubusercontent.com/u/4182027?v=4)](https://github.com/brentnd "brentnd (3 commits)")[![jeroenlammerts](https://avatars.githubusercontent.com/u/4282711?v=4)](https://github.com/jeroenlammerts "jeroenlammerts (2 commits)")[![rafaelbeckel](https://avatars.githubusercontent.com/u/28917?v=4)](https://github.com/rafaelbeckel "rafaelbeckel (2 commits)")

---

Tags

laravellumenmailsparkpostwebhooklaravelmaillumenwebhookssparkpost

### Embed Badge

![Health badge](/badges/brentnd-laravel-sparkposthooks/health.svg)

```
[![Health](https://phpackages.com/badges/brentnd-laravel-sparkposthooks/health.svg)](https://phpackages.com/packages/brentnd-laravel-sparkposthooks)
```

###  Alternatives

[eventhomes/laravel-mandrillhooks

A simple Mandrill webhook controller to help with events. Compatible with Laravel 5+ and Lumen 5+.

6375.3k](/packages/eventhomes-laravel-mandrillhooks)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)

PHPackages © 2026

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