clarkeash/shield

此包已被 废弃,不再维护。作者建议使用 laravel-shield/shield 包。

A laravel 中间件,用于防御第三方服务的未验证 webhook。

v1.0.1 2017-10-06 19:37 UTC

This package is auto-updated.

Last update: 2022-02-01 13:08:45 UTC


README

该项目已迁移至 https://github.com/laravel-shield/shield

我仍然欢迎您的贡献,请在此处阅读指南:http://laravel-shield.com/contributing




Shield

68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636c61726b656173682f736869656c642e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f636c61726b656173682f736869656c642e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f636c61726b656173682f736869656c642e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636c61726b656173682f736869656c642e7376673f7374796c653d666c61742d737175617265 687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d40636c61726b656173682d626c75652e7376673f7374796c653d666c61742d737175617265

Shield 是一个 Laravel 中间件,用于防御来自第三方服务的未验证 webhook。

安装

您可以使用 composer 引入此包。

$ composer require clarkeash/shield

发布包配置

$ php artisan vendor:publish --tag=config

使用

routes/api.php 中创建您的 webhook 路由,并添加中间件,如下所示

Route::middleware('shield:github')->post('/hooks/github', 'HooksController@github');

shield: 后面的名称是在 config/shield.phpenabled 部分中设置的。

服务

  • GitHub
  • GitLab
  • Stripe
  • Zapier

请随意提交 PR 以支持其他服务。