aporat/rate-limiter-middleware

This package is abandoned and no longer maintained. The author suggests using the aporat/laravel-rate-limiter package instead.

PHP Rate Limiter Middleware

dev-master 2016-01-11 21:42 UTC

This package is auto-updated.

Last update: 2020-08-24 03:59:19 UTC


README

Latest Stable Version Composer Downloads Build Status Code Coverage License

Installation

It's recommended that you use Composer to install this package.

$ composer require aporat/rate-limiter-middleware

This will install the package and all required dependencies.

Usage

Include the default middleware. By default, requests are rate limited per hour, minute and second.

<?php
use RateLimiter\Middleware as RateLimiterMiddleware;

$redis_settings = [
    'host' => '127.0.0.1',
    'port' => '6379'
  ];

$middlware = new RateLimiterMiddleware([], $redis_settings);
$app->add($middlware);