faaren-tech/webhook-receiver
Composer 安装命令:
composer require faaren-tech/webhook-receiver
包简介
Build to receive webhooks.
README 文档
README
Open Tasks
- Add authorization logic (e.g. for Stripe)
- Custom table name
Webhook Receiver
This package will be used by all FAAREN Services which receive webhooks. It provides a basic structure to handle incoming webhooks.
With this package you can simply define new endpoints for webhooks. Those webhooks will be stored within a database. Via a simple HandlerInterface you can define custom handlers for each of your endpoints.
This package also offers a basic CRUD functionality to interact with your stored webhooks via the Webhook model.
Installation
Call the following command:
composer require faaren-tech/webhook-receiver
The package is tested only for Laravel 8.x.
Config
Publish the relevant configuration file via (select the WebhookReceiverServiceProvider from the shown list):
php artisan vendor:publish
- You can customize the middleware separately for webhook endpoints and crud-routes.
- You can customize the prefix for both the webhook endpoints and the crud-routes.
Creating new endpoints
It is very easy to add new endpoints to your application.
- Create a new webhook handler, e.g.
MyExampleWebhookHandlerwithinapp/Http/WebhookEndpoints - Implement
FaarenTech\WebhookReceiver\Interfaces\WebhookEndpointHandlerInterface - Add the endpoint to your
config/webhook_receiverconfiguration file (see below) - Set up your new endpoint within your webhook sender (e.g. MailJet, Stripe, etc) for the endpoint
webhook/endpoints/my-example-endpoint
return [ // other configuration options 'endpoints' => [ 'my-example-endpoint' => MyExampleWebhookHandler::class ] ];
Example files
If you want you can take a look at the following files:
- ExampleRequests: Some simple examples. Can be executed directly from your favorite IDE (PhpStorm ;-))
- ExampleHandler: a example implementation
Testing
Add the relevant testsuite to your main phpunit.xml:
<testsuites> ... <testsuite name="FaarenTechWebhookReceiver"> <directory suffix="Test.php">./vendor/faaren-tech/webhook-receiver</directory> </testsuite> </testsuites>
faaren-tech/webhook-receiver 适用场景与选型建议
faaren-tech/webhook-receiver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 02 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 faaren-tech/webhook-receiver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 faaren-tech/webhook-receiver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-01