PHPackages                             settermjd/mezzio-twilio-webhook-validator - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. settermjd/mezzio-twilio-webhook-validator

ActiveLibrary[HTTP &amp; Networking](/categories/http)

settermjd/mezzio-twilio-webhook-validator
=========================================

This package provides middleware for validating Twilio webhooks.

0.1.1(9mo ago)00GPL-3.0-or-laterPHPPHP ~8.4CI passing

Since Sep 19Pushed 9mo agoCompare

[ Source](https://github.com/settermjd/mezzio-twilio-webhook-validator)[ Packagist](https://packagist.org/packages/settermjd/mezzio-twilio-webhook-validator)[ Fund](https://funding.communitybridge.org/projects/laminas-project)[ RSS](/packages/settermjd-mezzio-twilio-webhook-validator/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (12)Versions (3)Used By (0)

[![PHP QA Workflow](https://github.com/settermjd/mezzio-twilio-webhook-validator/actions/workflows/php-qa.yml/badge.svg)](https://github.com/settermjd/mezzio-twilio-webhook-validator/actions/workflows/php-qa.yml/badge.svg)

Mezzio Twilio Webhook Validator
===============================

[](#mezzio-twilio-webhook-validator)

This package provides [PSR-15-compliant middleware](https://www.php-fig.org/psr/psr-15/) for validating Twilio webhooks in [Mezzio](https://docs.mezzio.dev/mezzio/) applications.

Requirements
------------

[](#requirements)

To use the application, you'll need the following:

- A Twilio account (free or paid). [Create an account](https://twilio.com/try-twilio) if you don't already have one.
- PHP 8.4
- [Composer](https://getcomposer.org) installed globally

Usage
-----

[](#usage)

The package is designed to be used as part of Mezzio-based applications, and goes to a lot of effort to make doing so as simple as possible.

### Install the package

[](#install-the-package)

To install the package, use Composer by running the following command:

```
composer require settermjd/mezzio-twilio-webhook-validator
```

During installation, the project's [ConfigProvider](https://docs.laminas.dev/laminas-config-aggregator/config-providers/) will be loaded into your Mezzio application's *config/config.php*, loading all of the required services into the application's DI container.

### Set the required environment variables

[](#set-the-required-environment-variables)

The package requires two environment variables to be set: `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN`. To do that:

[![The Account Info panel in the Twilio Console's main dashboard, where the Account SID and Twilio phone number have been redacted](./docs/images/twilio-console-account-info-panel.png)](./docs/images/twilio-console-account-info-panel.png)

- Log in to [the Twilio Console](https://console.twilio.com) in your browser of choice
- Copy the **Account SID** and **Auth Token** from the **Account Info** panel in the Console's main dashboard
- Copy *.env.example* as *.env*
- In *.env* paste the two values as the values for `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN`, respectively

How to Use the Middleware
-------------------------

[](#how-to-use-the-middleware)

To use the middleware, you can pipe it so that it's used for every route. To do that, in *config/pipeline.php*, add the following **before** `DispatchMiddleware` is piped.

```
use Settermjd\Mezzio\Twilio\WebhookValidator\Middleware\WebhookValidatorMiddleware;

// ...

$app->pipe(WebhookValidatorMiddleware::class);
```

Alternatively, you can add it just for individual routes. To do that, configure the route's middleware as an array, with `WebhookValidatorMiddleware` listed before the route's handler.

```
use Settermjd\Mezzio\Twilio\WebhookValidator\Middleware\WebhookValidatorMiddleware;

// ...

$app->get(
    '/contact',
    [
        WebhookValidatorMiddleware::class,
        App\Handler\ContactHandler::class,
    ],
    'contact'
);
```

Contributing
------------

[](#contributing)

If you want to contribute to the project, whether you have found issues with it or just want to improve it, here's how:

- [Issues](https://github.com/settermjd/mezzio-twilio-webhook-validator/issues): ask questions and submit your feature requests, bug reports, etc
- [Pull requests](https://github.com/settermjd/mezzio-twilio-webhook-validator/issues): send your improvements

Did You Find the Project Useful?
--------------------------------

[](#did-you-find-the-project-useful)

If the project was useful, and you want to say thank you and/or support its active development, here's how:

Add a GitHub Star to the project Write an interesting article about the project wherever you blog

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance57

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

Every ~0 days

Total

2

Last Release

287d ago

### Community

Maintainers

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

---

Top Contributors

[![settermjd](https://avatars.githubusercontent.com/u/196801?v=4)](https://github.com/settermjd "settermjd (14 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/settermjd-mezzio-twilio-webhook-validator/health.svg)

```
[![Health](https://phpackages.com/badges/settermjd-mezzio-twilio-webhook-validator/health.svg)](https://phpackages.com/packages/settermjd-mezzio-twilio-webhook-validator)
```

###  Alternatives

[spiral/framework

Spiral, High-Performance PHP/Go Framework

2.1k2.2M66](/packages/spiral-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M125](/packages/mezzio-mezzio)[sunrise/http-router

A powerful solution as the foundation of your project.

17451.6k10](/packages/sunrise-http-router)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28591.3k3](/packages/mezzio-mezzio-authentication-oauth2)

PHPackages © 2026

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