Download the PHP package edenlife/superban without Composer
On this page you can find all versions of the php package edenlife/superban. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download edenlife/superban
More information about edenlife/superban
Files in edenlife/superban
Package superban
Short Description This package will add the ability to ban a client completely for a period of time
License MIT
Homepage https://github.com/Antonyodu/EdenLifeSuperBan
Informations about the package superban
Superban Laravel Package
Overview
Superban is a Laravel package designed to enhance your application's rate-limiting capabilities by providing the ability to ban clients completely for a specified period of time. This package integrates seamlessly with Laravel's built-in rate limiting features and allows you to configure different cache drivers such as Redis, Database, etc.
Installation
To get started with Superban, simply install the package through Composer:
composer require edenlife/superban
Configuration
In the superban.php
configuration file, you can:
- Specify Cache Driver:
- Choose the cache driver that Superban should use (e.g., Redis, Database).
- Set Ban Threshold:
- Configure the number of requests after which a client will be banned.
- Define Ban Duration:
- Specify the duration of the ban for a client after reaching the threshold.
- Choose Ban Criteria:
- Decide whether to ban by user ID, IP address, email, or a combination of these.
- Apply Bans Globally or Per Route:
- Choose whether to apply bans globally for all routes or specify particular routes.
Usage
To utilize Superban in your Laravel application, add the Superban middleware to the desired routes or apply it globally in your App\Http\Kernel
:
protected$middleware = [ // ... other middleware \SuperBanHttp\Middleware\SuperbanMiddleware::class, ];
Example Middleware Usage
Route::get('/protected-route', 'YourController@protectedAction')->middleware('superban:10,2,10');
Contributing
If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the GitHub repository.
License
Superban is open-sourced software licensed under the MIT License.