PHPackages                             rogervila/lumen-rate-limiting - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. rogervila/lumen-rate-limiting

ActiveLibrary[HTTP &amp; Networking](/categories/http)

rogervila/lumen-rate-limiting
=============================

 Lumen port of Laravel ThrottleRequests middleware

2.0.0(1y ago)1662.5k↓29.2%2[1 issues](https://github.com/rogervila/lumen-rate-limiting/issues)1MITPHP

Since Nov 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rogervila/lumen-rate-limiting)[ Packagist](https://packagist.org/packages/rogervila/lumen-rate-limiting)[ RSS](/packages/rogervila-lumen-rate-limiting/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (1)

[![Lumen Rate limiting](https://camo.githubusercontent.com/c2004ea7af2a52257cad64882dbfb7ed8185608fb6477cc031ca96222a372d45/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c756d656e253230526174652532306c696d6974696e672e706e673f7468656d653d6c69676874267061636b6167654e616d653d726f67657276696c612532466c756d656e2d726174652d6c696d6974696e67267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d4c756d656e2b706f72742b6f662b4c61726176656c2b5468726f74746c6552657175657374732b6d6964646c6577617265266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d736869656c642d636865636b)](https://camo.githubusercontent.com/c2004ea7af2a52257cad64882dbfb7ed8185608fb6477cc031ca96222a372d45/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c756d656e253230526174652532306c696d6974696e672e706e673f7468656d653d6c69676874267061636b6167654e616d653d726f67657276696c612532466c756d656e2d726174652d6c696d6974696e67267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d4c756d656e2b706f72742b6f662b4c61726176656c2b5468726f74746c6552657175657374732b6d6964646c6577617265266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d736869656c642d636865636b)

[![Total Downloads](https://camo.githubusercontent.com/d8fb13032423d9f2ea922cd2371edf75341cdadaf575b134ccc7dec0dc2bb6e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f67657276696c612f6c756d656e2d726174652d6c696d6974696e67)](https://packagist.org/packages/rogervila/lumen-rate-limiting)[![Latest Stable Version](https://camo.githubusercontent.com/4376d14a3d3193976689c0d94df3558bc6223fd3cbc04e5765c0272f7bc5735e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f67657276696c612f6c756d656e2d726174652d6c696d6974696e67)](https://packagist.org/packages/rogervila/lumen-rate-limiting)[![License](https://camo.githubusercontent.com/030d0a4618fc6dbafc124cc5aa7c2a8c2edfd43380238b4a1092fbdd76eda7d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726f67657276696c612f6c756d656e2d726174652d6c696d6974696e67)](https://packagist.org/packages/rogervila/lumen-rate-limiting)

About
-----

[](#about)

This package contains a Lumen port of Laravel's [ThrottleRequests middleware](https://github.com/laravel/framework/blob/master/src/Illuminate/Routing/Middleware/ThrottleRequests.php).

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

Lumenlumen-rate-limiting11.x2.x10.x1.x9.x1.x8.x1.xInstall
-------

[](#install)

1. Require the package on your Lumen application

```
composer require rogervila/lumen-rate-limiting
```

2. Make sure that `AppServiceProvider` and `AuthServiceProvider` are uncommented on `bootstrap/app.php`

```
$app->register(App\Providers\AppServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
```

3. 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());
    });
}
```

4. Register the middleware on `bootstrap/app.php`

```
$app->routeMiddleware([
    'throttle' => \LumenRateLimiting\ThrottleRequests::class,
]);
```

5. 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](https://lumen.laravel.com/docs/8.x/middleware#registering-middleware).

License
-------

[](#license)

This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~433 days

Total

4

Last Release

715d ago

Major Versions

1.2.0 → 2.0.02024-06-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/351443b7d23e94fcf31b250db90f0b9578cc9fd8e0cefbed9666467e3e9cb571?d=identicon)[rogervila](/maintainers/rogervila)

---

Top Contributors

[![rogervila](https://avatars.githubusercontent.com/u/6053012?v=4)](https://github.com/rogervila "rogervila (4 commits)")[![diegotibi](https://avatars.githubusercontent.com/u/25210612?v=4)](https://github.com/diegotibi "diegotibi (1 commits)")[![MzeeAlii](https://avatars.githubusercontent.com/u/18669218?v=4)](https://github.com/MzeeAlii "MzeeAlii (1 commits)")

---

Tags

laravellumenlimiterRate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rogervila-lumen-rate-limiting/health.svg)

```
[![Health](https://phpackages.com/badges/rogervila-lumen-rate-limiting/health.svg)](https://phpackages.com/packages/rogervila-lumen-rate-limiting)
```

###  Alternatives

[palanik/lumen-cors

Cross-origin resource sharing (CORS) middleware for Lumen micro-framework.

101237.4k](/packages/palanik-lumen-cors)[neomerx/cors-illuminate

CORS (Cross-Origin Resource Sharing) support for Laravel and Lumen

4996.4k2](/packages/neomerx-cors-illuminate)[noitran/opendox

OpenApi(Swagger) 3.0 package for Lumen 5.5+ and Laravel 5.5+ with REDOC UI and SwaggerUI 3

2313.9k](/packages/noitran-opendox)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
