PHPackages                             davematics/superban - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. davematics/superban

ActiveLibrary[Security](/categories/security)

davematics/superban
===================

This package will add the ability to ban a client completely for a period of time

v1.0.0(2y ago)03PHP

Since Dec 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Davematics/Superban)[ Packagist](https://packagist.org/packages/davematics/superban)[ RSS](/packages/davematics-superban/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Superban
========

[](#superban)

The package features a middleware named "superban," allowing you to control user access within your application.
If a user makes excessive requests within a specific timeframe, the middleware will temporarily block the user and later unblock them.

Installation
============

[](#installation)

You can install the package via Composer:

```
composer require davematics/superban
```

Manually add the service provider to the providers array in config/app.php:

```
'Superban' => Davematics\Superban\Facades\Superban::class,
```

After installation, publish the configuration file:

```
 php artisan vendor:publish --provider="Davematics\Superban\SuperbanServiceProvider"
```

This will publish a superban.php file in your config directory.
Here you can Configure different cache drivers. - Redis, Database, etc.

USAGE
=====

[](#usage)

```
Route::middleware(['superban:300,5,2880'])->group(function () {

 Route::post('/add-interest', [App\Http\Controllers\SomeController::class, 'index']);

});
```

```
Route::post('/add-interest', [App\Http\Controllers\SomeController::class, 'index'])->middleware(['superban:300,5,2880']);
```

The middleware utilizes Laravel's RateLimiter class to track the number of attempts a user makes to access a resource within a specific time frame.
If the user surpasses the limit, the middleware generates a key based on the user's email, ID, or IP address and stores it in the cache for the designated time period. If the key is found in the cache, the middleware raises a UserBannedException.

Example
=======

[](#example)

The "superban" middleware accepts three parameters:

The first parameter is the number of attempts a user can make before being banned.
The second parameter is number of minutes during which the user can attempt the route before facing a ban.
The last parameter is the number of minutes the user is banned.

On the route you can chnage the parameters 300, 5, 2880 based to fit in your specification.

Tests
=====

[](#tests)

To run the package tests, use the following bash command:

```
./vendor/bin/phpunit
```

Security
========

[](#security)

If you find any security-related concerns, kindly reach out via email to: .

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

925d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6b57fee255c08a4a64e37cbbff5e6f9a6ef9325aa9a9a7bd9649d4e100781f6?d=identicon)[Davematics](/maintainers/Davematics)

---

Top Contributors

[![Davematics](https://avatars.githubusercontent.com/u/42449119?v=4)](https://github.com/Davematics "Davematics (12 commits)")

### Embed Badge

![Health badge](/badges/davematics-superban/health.svg)

```
[![Health](https://phpackages.com/badges/davematics-superban/health.svg)](https://phpackages.com/packages/davematics-superban)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.7M142](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k37](/packages/paragonie-ecc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
