Download the PHP package yunwuxin/think-throttle without Composer
On this page you can find all versions of the php package yunwuxin/think-throttle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download yunwuxin/think-throttle
More information about yunwuxin/think-throttle
Files in yunwuxin/think-throttle
Download yunwuxin/think-throttle
More information about yunwuxin/think-throttle
Files in yunwuxin/think-throttle
Vendor yunwuxin
Package think-throttle
Short Description Throttle is a rate limiter for thinkphp6
License Apache-2.0
Package think-throttle
Short Description Throttle is a rate limiter for thinkphp6
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package think-throttle
安装
composer require yunwuxin/think-throttle
下面示例均为限制每分钟允许10次访问
使用方式
门面方式
依赖注入方式
中间件方式
中间件支持3个参数 $maxAttempts
, $decayMinutes
, $prefix
...->middleware(ThrottleRequests::class, $maxAttempts, $decayMinutes, $prefix);
$maxAttempts
: 可访问次数,默认值60
$decayMinutes
: 单位时间,默认值1分钟
$prefix
: $key的前缀,默认值为空,可以传入一个闭包,返回一个字符串作为$key,该闭包支持依赖注入
All versions of think-throttle with dependencies
PHP Build Version
Package Version
The package yunwuxin/think-throttle contains the following files
Loading the files please wait ....