settermjd/mezzio-twilio-webhook-validator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

settermjd/mezzio-twilio-webhook-validator

最新稳定版本:0.1.1

Composer 安装命令:

composer require settermjd/mezzio-twilio-webhook-validator

包简介

This package provides middleware for validating Twilio webhooks.

README 文档

README

PHP QA Workflow

Mezzio Twilio Webhook Validator

This package provides PSR-15-compliant middleware for validating Twilio webhooks in Mezzio applications.

Requirements

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

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

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

composer require settermjd/mezzio-twilio-webhook-validator

During installation, the project's ConfigProvider 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

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

  • Log in to the Twilio Console 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

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

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: ask questions and submit your feature requests, bug reports, etc
  • Pull requests: send your improvements

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-09-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固