aporat / laravel-rate-limiter by aporat

Request and actions rate limiter middleware for Laravel and Lumen
199
2
2
Package Data
Maintainer Username: aporat
Maintainer Contact: adar.porat@gmail.com (Adar Porat)
Package Create Date: 2020-08-22
Package Last Update: 2021-04-05
Language: PHP
License: MIT
Last Refreshed: 2024-04-22 03:00:57
Package Statistics
Total Downloads: 199
Monthly Downloads: 0
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.