PHPackages                             citricguy/postmark-webhooks-laravel - 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. citricguy/postmark-webhooks-laravel

ActiveLaravel-package[API Development](/categories/api)

citricguy/postmark-webhooks-laravel
===================================

Allow your Laravel project to listen for webhooks sent from PostmarkApp.

v2.1.0(1mo ago)0125MITPHPPHP ^8.3CI passing

Since Sep 16Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/citricguy/postmark-webhooks-laravel)[ Packagist](https://packagist.org/packages/citricguy/postmark-webhooks-laravel)[ RSS](/packages/citricguy-postmark-webhooks-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (10)Versions (13)Used By (0)

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

[](#postmark-webhooks-for-laravel)

You're looking for an easy to implement package, that accepts webhooks from PostmarkApp.com. This package does just that.

This no-frills solution provides a simple api to accept webhooks from PostmarkApp.com and then fire an event that you can listen for in your application.

There are no added migrations, no models, only a single event that you can listen for and then do whatever you want with the payload.

It is configurable, easy to use and utilizes middleware to ensure the webhooks are coming from PostmarkApp.com.

### Requirements

[](#requirements)

- Laravel 12.x or 13.x
- PHP 8.3|8.4|8.5
- An active PostmarkApp.com account.

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

[](#installation)

You can install this package using composer:

```
composer require citricguy/postmark-webhooks-laravel
```

Configure webhooks in your Postmark account
-------------------------------------------

[](#configure-webhooks-in-your-postmark-account)

On the servers page of your Postmark account choose the server and stream you would like to receive webhooks from.

Once there, go to 'settings' -&gt; 'webhooks' -&gt; 'add webhook'.

Add your webhook URL which is `https:///api/postmark/webhook` by default (this is configurable).

Select the events Postmark should send to your webhook and then save.

Event Configuration
-------------------

[](#event-configuration)

Listening for the `PostmarkWebhookReceived` event is the primary way we'll interact with the webhooks.

If you haven't used events or listener before, please see the Laravel documentation regarding [events](https://laravel.com/docs/events).

In short, we'll create a listener, register it in our `EventServiceProvider` and then handle the event in our listener.

```
/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    PostmarkWebhookReceived::class => [
        ListenerClasses::class, // Create with `php artisan make:listener `
    ],
];
```

Here is an example listener:

```
