PHPackages                             ircop/antiflood - 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. ircop/antiflood

ActiveLibrary[Security](/categories/security)

ircop/antiflood
===============

Request flood protection for laravel

v0.1.4(8y ago)2024.2k↓50%3[1 issues](https://github.com/ircop/antiflood/issues)1GPLv2PHPPHP &gt;=5.3

Since Nov 12Pushed 8y agoCompare

[ Source](https://github.com/ircop/antiflood)[ Packagist](https://packagist.org/packages/ircop/antiflood)[ RSS](/packages/ircop-antiflood/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (6)Used By (1)

Small antiflood system for Laravel
==================================

[](#small-antiflood-system-for-laravel)

This tool designed for simple limiting some user requests. It makes it easy to add some protection from DB ddos or bruteforce attack.

INSTALL
-------

[](#install)

1: install via composer

```
composer require ircop/antiflood

```

2: add service provider to `providers` array in `config/app.php`:

```
Ircop\Antiflood\AntifloodServiceProvider::class,

```

3: add facade alias to `aliases` array in `config/app.php`:

```
'Antiflood' => Ircop\Antiflood\Facade\Antiflood::class,

```

Usage
-----

[](#usage)

Checking for record existance with given ident.

Ident can be ip-address, login, anything unique.

$maximum - is maximum allowed value for this ident. Default is 1.

```
\Antiflood::check( $ident, $maximum = 1 );

// Or with IP identity

\Antiflood::checkIP( $maximum = 1 );
```

Putting record for given ident on given $minutes:

```
\Antiflood::put( $ident, $minutes = 10 );

// Or with IP identity

\Antiflood::putIP( $minutes = 10 );
```

Examples:
---------

[](#examples)

#### Limiting wrong login attempts for given IP address:

[](#limiting-wrong-login-attempts-for-given-ip-address)

This example limiting wrong login attempts from one ip-address to 5 tryes per 20 minutes:

```
public function postLogin()
{
	$key = $_SERVER['REMOTE_ADDR'];

	// If this ip has >= 5 failed login attempts in last 20 minutes, redirect user
	// back with error:
	if( \Antiflood::check( $key, 5 ) === FALSE )
		return redirect()->back()->withErrors(['Too many login attempts! Try again later.']);

	// ....
	// ....
	// ....

	// After failed login put user ipaddr to antiflood cacte on 20 min.
	// If there is no records with this ident, record will be added with value=1, else
	// it will be increased.
	\Antiflood::put( $key, 20 );
}

```

#### Limiting password recovery for 1 try per 30 min.

[](#limiting-password-recovery-for-1-try-per-30-min)

This code shows how to limit some functions like email, etc. to prevend flood from our server, for example.

```
public function postPasswordRecover()
{
	$key = \Input::get('email');
	if( \Antiflood::check( $key ) === FALSE )
		return redirect()->back()->withErrors(['.....']);

	// ....
	// ....
	// ....

	\Antiflood::put( $key, 20 );
}

```

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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

Every ~155 days

Total

5

Last Release

3207d ago

PHP version history (2 changes)v0.1PHP &gt;=5.5

v0.1.1PHP &gt;=5.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2287048?v=4)[ircop](/maintainers/ircop)[@ircop](https://github.com/ircop)

---

Top Contributors

[![ircop](https://avatars.githubusercontent.com/u/2287048?v=4)](https://github.com/ircop "ircop (5 commits)")[![vzool](https://avatars.githubusercontent.com/u/4952736?v=4)](https://github.com/vzool "vzool (2 commits)")

---

Tags

laravelspamfloodantiflood

### Embed Badge

![Health badge](/badges/ircop-antiflood/health.svg)

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

###  Alternatives

[msurguy/honeypot

Honeypot spam prevention

4381.2M12](/packages/msurguy-honeypot)[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

999465.8k2](/packages/akaunting-laravel-firewall)[soved/laravel-gdpr

GDPR compliance with ease

299127.5k2](/packages/soved-laravel-gdpr)[masterro/laravel-xss-filter

Filter user input for XSS but don't touch other html

41254.5k](/packages/masterro-laravel-xss-filter)[enlightn/laravel-security-checker

A Laravel package to scan your dependencies for known security vulnerabilities.

51173.4k](/packages/enlightn-laravel-security-checker)[nickurt/laravel-pwned-passwords

PwnedPasswords for Laravel 11.x/12.x/13.x

187.5k](/packages/nickurt-laravel-pwned-passwords)

PHPackages © 2026

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