承接 rogervila/lumen-rate-limiting 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

rogervila/lumen-rate-limiting

最新稳定版本:2.0.0

Composer 安装命令:

composer require rogervila/lumen-rate-limiting

包简介

Lumen port of Laravel ThrottleRequests middleware

README 文档

README

Lumen Rate limiting

Total Downloads Latest Stable Version License

About

This package contains a Lumen port of Laravel's ThrottleRequests middleware.

Check the package version compatibility based on your Lumen's project version:

Lumen lumen-rate-limiting
11.x 2.x
10.x 1.x
9.x 1.x
8.x 1.x

Install

  1. Require the package on your Lumen application
composer require rogervila/lumen-rate-limiting
  1. Make sure that AppServiceProvider and AuthServiceProvider are uncommented on bootstrap/app.php
$app->register(App\Providers\AppServiceProvider::class); $app->register(App\Providers\AuthServiceProvider::class);
  1. Configure a rate limiter on the AppServiceProvider boot method
/**  * Configure global rate limiter  *  * @return void  */ public function boot() { app(\Illuminate\Cache\RateLimiter::class)->for('global', function () { return \Illuminate\Cache\RateLimiting\Limit::perMinute(60)->by(request()->ip()); }); }
  1. Register the middleware on bootstrap/app.php
$app->routeMiddleware([ 'throttle' => \LumenRateLimiting\ThrottleRequests::class, ]);
  1. Add the middleware to the global router group on bootstrap/app.php
$app->router->group([ 'namespace' => 'App\Http\Controllers', 'middleware' => 'throttle:global', ], function ($router) { require __DIR__ . '/../routes/web.php'; });

The middleware can be placed on specific routes instead of globally, as defined on the official documentation.

License

This project is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固