PHPackages                             nickurt/laravel-abuseipdb - 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. nickurt/laravel-abuseipdb

ActiveLibrary[Security](/categories/security)

nickurt/laravel-abuseipdb
=========================

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

3.1(1mo ago)166592MITPHPPHP ^8.2CI passing

Since Feb 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nickurt/laravel-abuseipdb)[ Packagist](https://packagist.org/packages/nickurt/laravel-abuseipdb)[ RSS](/packages/nickurt-laravel-abuseipdb/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (13)Used By (0)

Laravel AbuseIpDb
-----------------

[](#laravel-abuseipdb)

[![Build Status](https://github.com/nickurt/laravel-abuseipdb/workflows/tests/badge.svg)](https://github.com/nickurt/laravel-abuseipdb/actions)[![Total Downloads](https://camo.githubusercontent.com/b254a49f5587dd4219482d16d0841e042c0e9a5cad10170622ce3aca033167f3/68747470733a2f2f706f7365722e707567782e6f72672f6e69636b7572742f6c61726176656c2d6162757365697064622f642f746f74616c2e737667)](https://packagist.org/packages/nickurt/laravel-abuseipdb)[![Latest Stable Version](https://camo.githubusercontent.com/272ae1c5c4ab4453cb489ac5d3dbbaca6d430c43b5cd3431a33b7c6f78ac1e21/68747470733a2f2f706f7365722e707567782e6f72672f6e69636b7572742f6c61726176656c2d6162757365697064622f762f737461626c652e737667)](https://packagist.org/packages/nickurt/laravel-abuseipdb)[![MIT Licensed](https://camo.githubusercontent.com/9b0a31079c81533a5bf0eddd864f78dae4088990a3d53d48245f3df6a2847d55/68747470733a2f2f706f7365722e707567782e6f72672f6e69636b7572742f6c61726176656c2d6162757365697064622f6c6963656e73652e737667)](LICENSE.md)

### Installation

[](#installation)

Install this package with composer:

```
composer require nickurt/laravel-abuseipdb

```

Copy the config files for the AbuseIpDb-plugin

```
php artisan vendor:publish --provider="nickurt\AbuseIpDb\ServiceProvider" --tag="config"

```

### Configuration

[](#configuration)

The AbuseIpDb information can be set with environment values in the `.env` file (or directly in the `config/abusedbip.php` file)

```
ABUSEIPDB_APIKEY=MY_UNIQUE_APIKEY

```

### Examples

[](#examples)

#### Validation Rule - IsSpamIp

[](#validation-rule---isspamip)

You can use a hidden-field `aip` in your Form-Request to validate if the request is valid

```
$validator = validator()->make(['aip' => 'aip'], ['aip' => [new \nickurt\AbuseIpDb\Rules\IsSpamIp(
    request()->ip(), 100
)]]);
```

The `IsSpamIp` requires a `ip` and an optional `days` parameter to validate the request.

#### Manually Usage - IsSpamIp

[](#manually-usage---isspamip)

```
$isSpamIp = \AbuseIpDb::setIp('8.8.8.8')->isSpamIp();

// Same
$isSpamIp = abuseipdb()->setIp('8.8.8.8')->isSpamIp();
$isSpamIp = abuseipdb()->isSpamIp('8.8.8.8');

// Cache the result for 10 minutes (default 10 seconds)
abuseipdb()->setCacheTTL(600);

// Lower the required abuse confidence score from 100 (max) to 90%
abuseipdb()->setSpamThreshold(90);

// Report an IP in categories 18 (Brute-Force) and 22 (SSH)
// For categories see https://www.abuseipdb.com/categories
$updatedAbuseConfidence = abuseipdb()->reportIp('18,22', '127.0.0.1', 'SSH login attempts with user root.');

// Catch exceptions
try {
    abuseipdb()->isSpamIp('invalid-ip');
} catch(\nickurt\AbuseIpDb\AbuseIpDbException $exception) {
    dd($exception->getMessage());

    // "The ip address must be a valid IPv4 or IPv6 address (e.g. 8.8.8.8 or 2001:4860:4860::8888)."
}

try {
    // Do it twice (happens eg if hacker accesses two invalid urls and each reports this IP)
    // Both commands do the same in just two different ways

    abuseipdb()->setIp('127.0.0.2')->reportIp('18,22');
    abuseipdb()->reportIp('18,22', '127.0.0.2');
} catch(\nickurt\AbuseIpDb\AbuseIpDbException $exception) {
    dd($exception->getMessage());

    // "You can only report the same IP address (`127.0.0.2`) once in 15 minutes."
}
```

#### Events

[](#events)

You can listen to the `IsSpamIp` event, e.g. if you want to log the `IsSpamIp`-requests in your application

##### IsSpamIp Event

[](#isspamip-event)

This event will be fired when the request-ip is above the frequency of sending spam `nickurt\AbuseIpDb\Events\IsSpamIp`

### Testing

[](#testing)

Run the tests with:

```
composer test
```

---

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance64

Regular maintenance activity

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 78.6% 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 ~268 days

Recently: every ~502 days

Total

12

Last Release

54d ago

Major Versions

1.2 → 2.02019-07-06

2.6 → 3.02025-02-26

PHP version history (5 changes)1.0PHP ^7.0

1.1PHP ^7.1.3

1.2PHP ^7.2

2.5PHP ^8.0|^7.4

2.6PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/41ad8e23eeb9da6d6c8495ba9bb8021aeeba1d45307b7dad2c70c3fa6703d713?d=identicon)[nickurt](/maintainers/nickurt)

---

Top Contributors

[![nickurt](https://avatars.githubusercontent.com/u/5840084?v=4)](https://github.com/nickurt "nickurt (33 commits)")[![lanort](https://avatars.githubusercontent.com/u/57423?v=4)](https://github.com/lanort "lanort (8 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

abuseipdblaravellaravel-abuseipdbspamlaravelabuseipdb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nickurt-laravel-abuseipdb/health.svg)

```
[![Health](https://phpackages.com/badges/nickurt-laravel-abuseipdb/health.svg)](https://phpackages.com/packages/nickurt-laravel-abuseipdb)
```

###  Alternatives

[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)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)[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)
