eden-life/superban

The skeleton application for the Laravel framework.

dev-main 2023-12-19 14:41 UTC

This package is auto-updated.

Last update: 2024-04-19 15:23:46 UTC


README

The Superban Laravel Package provides rate limiting and banning features for API clients based on their behavior. It is designed to be easily integrated into Laravel applications.

Installation

To install the package via composer, run:

composer require edenlife/superban

Configuration

After installation, publish the configuration file:

php artisan vendor:publish --tag=superban-config

This will publish a superban.php file in your config directory.

Usage

Middleware

Apply the Superban middleware to specific routes using the following syntax:

use EdenLife\Superban\Middleware\SuperbanMiddleware;

Route::middleware([SuperbanMiddleware::class . ':200,2,1440'])->group(function () {
    // Your routes here
});

Adjust the parameters 200, 2, 1440 based on your desired rate limiting and banning configuration.

Tests

To run the package tests, use bash to run:

./vendor/bin/phpunit

Contributing

Thank you for considering contributing to the Superban package! Feel free to open issues or submit pull requests.

Security

If you discover any security-related issues, please email: anipreciousebuka@gmail.com.