API RATE LIMITER is a package that provides a middelware for laravel applications to enforce rate limiting on incoming API requests using the Token Bucket Algorithm, it helps to prevent abuse of API resources and ensures fair access to the API for all users
oussema-khlifi/api-rate-limiter is a Laravel package for api rate limiter is a package that provides a middelware for laravel applications to enforce rate limiting on incoming api requests using the token bucket algorithm, it helps to prevent abuse of api resources and ensures fair access to the api for all users.
It currently has 1 GitHub stars and 0 downloads on Packagist.
Install it with composer require oussema-khlifi/api-rate-limiter.
Discover more Laravel packages by oussema-khlifi
or browse all Laravel packages to compare alternatives.
Last updated
The API Rate Limiter package provides a middleware for Laravel applications to implement rate limiting on incoming API requests using the Token Bucket Algorithm. Rate limiting helps prevent abuse of API resources and ensures fair access to the API for all users.
Install the package via Composer:
composer require oussema-khlifi/api-rate-limiter
Import the ApiRateLimiterMiddleware in your App\Http\Kernel.php file. Apply the middleware to specific API routes or globally in the middleware stack.
use OussemaKhlifi\ApiRateLimiter\Middleware\ApiRateLimiterMiddleware;
protected $middlewareGroups = [
'api' => [
// Other middleware...
ApiRateLimiterMiddleware::class,
],
];
The default rate limiting settings can be modified in the config/api_rate_limiter.php configuration file:
return [
'tokens_per_minute' => 60,
'max_tokens' => 60,
];
This package is open-source software licensed under the MIT License.
If you encounter any issues or have questions, please open an issue.
Contributions are welcome! If you wish to contribute, please fork the repository, create a new branch, and submit a pull request.