New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

rogervila/lumen-rate-limiting

Lumen port of Laravel ThrottleRequests middleware
73,241 16

Larablocks Analysis

rogervila/lumen-rate-limiting works with any PHP project: the latest release (2.0.0, Jun 3, 2024) doesn't depend on Laravel.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • No release in the last 12 months (last: Jun 3, 2024)
  • 1,632 downloads a month (needs 10,000)
  • 16 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jun 3, 2024.
  • No releases in the last 12 months.
  • First released: Nov 10, 2020.
  • Monthly downloads: 1,632, up 38% from six months ago.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require rogervila/lumen-rate-limiting
Latest Version:2.0.0
License:MIT
Last Updated:Jun 3, 2024
Links: GitHub  ·  Packagist
Maintainer: rogervila
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.

Related Packages

kiendaotac/lumen-installer

Lumen application installer.

12 0
appzcoder/lumen-routes-list

Display the route list of Lumen

750,325 117
codeception/module-lumen

Codeception module for Lumen framework

170,303 0
mlntn/lumen-artisan-serve

artisan serve for Lumen projects

100,932 49
cosmicvelocity/lumen-helpers

Improves interoperability between Lumen and Laravel.

66,214 6

Version History

Version Released License
2.0.0 MIT
1.2.0 MIT
1.1.0 MIT
1.0.0 MIT