oanhnn/laravel-webhook-shield
Composer 安装命令:
composer require oanhnn/laravel-webhook-shield
包简介
Protects against unverified webhooks from 3rd party services on Laravel 5.5+
README 文档
README
Protects against unverified webhooks from 3rd party services on Laravel 5.5+
Features
- Supported Laravel 5.5+
- Allow multi services with same driver (Useful for two webhook endpoints of two facebook applications)
- Supported drivers
- Bitbucket
- Github
- Gitlab
- Mailgun
- Shopify
- Trello
- Easy to extend more drivers
Requirements
- php >=7.1.3
- Laravel 5.5+
Laravel 6.0+ required php 7.2+
Installation
Begin by pulling in the package through Composer.
$ composer require oanhnn/laravel-webhook-shield
The package will automatically register itself.
You can publish the config-file with:
$ php artisan vendor:publish --provider=Laravel\WebhookShield\ServiceProvider
Usage
Configure services
In configuration file, you can define services
<?php return [ 'services' => [ 'github' => [ 'driver' => 'github', 'options' => [], ], 'facebook' => [ 'driver' => \Laravel\WebhookShield\Services\Facebook::class, 'options' => [], ], 'custom' => [ 'driver' => 'custom-driver', 'options' => [], ], ], ];
Protects webhook routes
Route::middleware('shield:facebook')->post('/webhook/facebook', 'WebhookController@facebook'); Route::middleware('shield:github')->post('/webhook/facebook', 'WebhookController@github'); Route::middleware('shield:custom')->post('/webhook/custom', 'WebhookController@custom');
Make custom driver
Make a service implement class
<?php namespace App\Services; use Laravel\WebhookShield\Contracts\Service; class CustomService implements Service { // ... }
And register this driver in app/Providers/AppServiceProvider.php
<?php namespace App\Providers; use App\Services\CustomService; use Illuminate\Support\ServiceProvider; use Laravel\WebhookShield\Facades\Shield; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Shield::extend('custom-driver', function ($app, $config) { return new CustomService($config); }); // ... } /** * Register any application services. * * @return void */ public function register() { // ... } }
Changelog
See all change logs in CHANGELOG
Testing
$ git clone git@github.com/oanhnn/laravel-webhook-shield.git /path
$ cd /path
$ composer install
$ composer phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.
Credits
License
This project is released under the MIT License.
Copyright © 2018-2019 Oanh Nguyen.
oanhnn/laravel-webhook-shield 适用场景与选型建议
oanhnn/laravel-webhook-shield 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 290 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「laravel」 「webhook」 「shield」 「protected-webhook」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 oanhnn/laravel-webhook-shield 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oanhnn/laravel-webhook-shield 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 oanhnn/laravel-webhook-shield 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Inbox pattern process implementation for your Laravel Applications
Simple ASCII output of array data
GitHub Webhook Listener with plugin-based API for creating your own triggerered actions
Alfabank REST API integration
Package for view storage in laravel
统计信息
- 总下载量: 290
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-12-14