aporat / laravel-rate-limiter by aporat

Request and actions rate limiter middleware for Laravel and Lumen
218
2
2
Package Data
Maintainer Username: aporat
Maintainer Contact: aporat28@gmail.com (aporat28)
Package Create Date: 2020-08-22
Package Last Update: 2024-11-25
Language: PHP
License: MIT
Last Refreshed: 2024-12-18 03:01:11
Package Statistics
Total Downloads: 218
Monthly Downloads: 19
Daily Downloads: 0
Total Stars: 2
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Laravel Rate Limiter

Latest Stable Version Composer Downloads Build Status Code Coverage Scrutinizer Code Quality

Request and actions rate limiter middleware for Laravel and Lumen

Installation

The filter-var service provider can be installed via Composer.

composer require aporat/laravel-rate-limiter

To use the RateLimiter service provider, you must register the provider when bootstrapping your application.

Laravel

Laravel 5.5 and above

The package will automatically register provider and facade.

Laravel 5.4 and below

Add Aporat\RateLimiter\RateLimiterServiceProvider to the providers section of your config/app.php:

    'providers' => [
        // ...
        Aporat\RateLimiter\RateLimiterServiceProvider::class,
    ];

Add RateLimiter facade to the aliases section of your config/app.php:

    'aliases' => [
        // ...
        'RateLimiter' => Aporat\RateLimiter\Facade\RateLimiter::class,
    ];

Or use the facade class directly:

  use Aporat\RateLimiter\Facade\RateLimiter;

Now run php artisan vendor:publish to publish config/rate-limiter.php file in your config directory.

Lumen

Register the Aporat\RateLimiter\RateLimiterServiceProvider in your bootstrap/app.php:

    $app->register(Aporat\RateLimiter\RateLimiterServiceProvider::class);

Copy the filter-var.php config file in to your project:

    mkdir config
    cp vendor/aporat/laravel-rate-limiter/Config/rate-limiter.php config/rate-limiter.php

Configuration

Usage

Credits

License

The MIT License (MIT). Please see License File for more information.