A robust and customizable rate-limiting middleware for laravel
rapidsquirrel/laravel-rate-limiter is a Laravel package for a robust and customizable rate-limiting middleware for laravel.
It currently has 1 GitHub stars and 0 downloads on Packagist.
Install it with composer require rapidsquirrel/laravel-rate-limiter.
Discover more Laravel packages by rapidsquirrel
or browse all Laravel packages to compare alternatives.
Last updated
This project implements a rate limiter for a Laravel application, providing protection against excessive requests and potential abuse.
git clone https://github.com/amrq88/laravel-rate-limiter.git
cd laravel-rate-limiter
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
You can configure the rate limiter settings in the config/rate_limiter.php file.
return [
'limits' => [
'default' => [
'max_attempts' => 60,
'decay_minutes' => 1,
],
// Add other rate limit configurations here
],
];
Apply the rate limiter middleware to your routes in routes/web.php or routes/api.php:
use App\Http\Middleware\RateLimiter;
Route::middleware([RateLimiter::class])->group(function () {
Route::get('/your-route', [YourController::class, 'yourMethod']);
});
If you would like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
For any inquiries, please contact Amr Qawasmeh.