PHPackages                             ritey/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ritey/laravel-abuseipdb

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ritey/laravel-abuseipdb
=======================

AbuseIpDb for Laravel 6.x/7.x/8.x/9.x

0.1.x-dev(3y ago)03MITPHPPHP ^8.0|^7.4

Since Aug 13Pushed 3y agoCompare

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

READMEChangelogDependencies (3)Versions (2)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

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

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

1368d ago

### Community

Maintainers

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

---

Top Contributors

[![nickurt](https://avatars.githubusercontent.com/u/5840084?v=4)](https://github.com/nickurt "nickurt (26 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)")[![ritey](https://avatars.githubusercontent.com/u/588686?v=4)](https://github.com/ritey "ritey (1 commits)")

---

Tags

laravelabuseipdb

### Embed Badge

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

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

202832.4k6](/packages/backpack-basset)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[nickurt/laravel-akismet

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

97139.6k2](/packages/nickurt-laravel-akismet)

PHPackages © 2026

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