PHPackages                             unrulynatives/laravel-abuse-ip - 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. unrulynatives/laravel-abuse-ip

ActiveLibrary[Security](/categories/security)

unrulynatives/laravel-abuse-ip
==============================

Block ip address of all spammer's around the world.

0193PHP

Since Feb 15Pushed 1y agoCompare

[ Source](https://github.com/UnrulyNatives/Laravel-Abuse-IP)[ Packagist](https://packagist.org/packages/unrulynatives/laravel-abuse-ip)[ RSS](/packages/unrulynatives-laravel-abuse-ip/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Abuse Ip](https://private-user-images.githubusercontent.com/40790503/351979881-ff47c6b4-297f-4984-ae5d-1829b61bd4c6.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzIyNjk3MzksIm5iZiI6MTc3MjI2OTQzOSwicGF0aCI6Ii80MDc5MDUwMy8zNTE5Nzk4ODEtZmY0N2M2YjQtMjk3Zi00OTg0LWFlNWQtMTgyOWI2MWJkNGM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAyMjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMjI4VDA5MDM1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY5Y2MwNjJlNTViOWZhYmEwMDdiZmQxZTYxODcxNjI2MTQ3MzEzZmYwZGVhODhhODg5Y2ZlYWVjN2I2ZDUxNTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.D6DpBkuMjqyGisSEs16slintMdinUVyXajG6mpVOzCQ)](https://private-user-images.githubusercontent.com/40790503/351979881-ff47c6b4-297f-4984-ae5d-1829b61bd4c6.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzIyNjk3MzksIm5iZiI6MTc3MjI2OTQzOSwicGF0aCI6Ii80MDc5MDUwMy8zNTE5Nzk4ODEtZmY0N2M2YjQtMjk3Zi00OTg0LWFlNWQtMTgyOWI2MWJkNGM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAyMjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMjI4VDA5MDM1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY5Y2MwNjJlNTViOWZhYmEwMDdiZmQxZTYxODcxNjI2MTQ3MzEzZmYwZGVhODhhODg5Y2ZlYWVjN2I2ZDUxNTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.D6DpBkuMjqyGisSEs16slintMdinUVyXajG6mpVOzCQ)

Laravel Abuse-IP
================

[](#laravel-abuse-ip)

\##Keep you webiste safe from spammer.

[![Packagist Downloads](https://camo.githubusercontent.com/4d2fa36a9ba3709e86c67344797b0d25ad57b9561879ec2cd2a9106b2bffe639/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726168756c616c616d33312f4c61726176656c2d41627573652d4950)](https://camo.githubusercontent.com/4d2fa36a9ba3709e86c67344797b0d25ad57b9561879ec2cd2a9106b2bffe639/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726168756c616c616d33312f4c61726176656c2d41627573652d4950) [![Packagist Version](https://camo.githubusercontent.com/696b8063758720f930fb7c4a811ac39733deefcf71011160e8a2cdd775ccef3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726168756c616c616d33312f4c61726176656c2d41627573652d4950)](https://camo.githubusercontent.com/696b8063758720f930fb7c4a811ac39733deefcf71011160e8a2cdd775ccef3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726168756c616c616d33312f4c61726176656c2d41627573652d4950) [![License: MIT](https://camo.githubusercontent.com/95b17b8a8a53581ad8706ab0750dae2a0673e122a54d6018ef302bdb1b559f9f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d504c253230322e302d627269676874677265656e2e737667)](https://opensource.org/license/mit) [![Update SPAM IP List](https://github.com/rahulalam31/Laravel-Abuse-IP/actions/workflows/update_spamiplist.yml/badge.svg)](https://github.com/rahulalam31/Laravel-Abuse-IP/actions/workflows/update_spamiplist.yml)

Adds a Security to Laravel for checking whether the IP address is safe or marked as spam to keep you out of worry from spammers and fake data to your website. Uses the AbuseIPDB blocklist from [borestad/blocklist-abuseipdb](https://github.com/borestad/blocklist-abuseipdb) by default.

### Installation

[](#installation)

1. Run the Composer require command to install the package. The service provider is discovered automatically.

    ```
    composer require rahulalam31/laravel-abuse-ip
    ```
2. Publish the configuration file and adapt the configuration as desired:

    ```
    php artisan vendor:publish --tag=laravel-abuse-ip
    ```
3. Run the following artisan command to fetch an up-to-date list of disposable domains:

    ```
    php artisan abuseip:update
    ```

3.1. Add the following to you `.env` file. Add `ABUSEIP_STORAGE_PATH` to change your storage location, Add `ABUSEIP_STORAGE_COMPRESS` `true/false` to enable or disable `ip2long()`

4. (optional) It's highly advised to update the AbuseIp list daily as the spam ip address keeps changing daily, but you can schedule it as per your need regularly. You can either run the command yourself now and then or, if you make use of Laravel's scheduler, you can register the `abuseip:update` command:

    In `routes/console.php`:

    ```
    use Illuminate\Support\Facades\Schedule;
    //
    Schedule::command('abuseip:update')->daily();
    ```

    Or if you use Laravel 10 or below, head over to the Console kernel:

    ```
     protected function schedule(Schedule $schedule)
     {
         $schedule->command('abuseip:update')->daily();
     }
    ```

### Usage

[](#usage)

Use the `middleware::AbuseIp::class` where ever required like in form page or post urls.Or you can add the middleware to your code, For Laravel 10 and below add the middleware `Http/Kernel.php`, For Laravel 11 add to `bootstrap/app/php`

```
//Laravel 10 and below
/*
 * app/Http/Kernel.php
*/

protected $middleware = [
        \RahulAlam31\LaravelAbuseIp\Middleware\AbuseIp::class,
        .....
]
```

```
//Laravel 11
/*
 * bootstrap/app.php
*/
->withMiddleware(function (Middleware $middleware) {
        $middleware->append(\RahulAlam31\LaravelAbuseIp\Middleware\AbuseIp::class);
    })
```

If you don't want to put it in your route middleware you can make a `aliasMiddleware()` and use the alias in your routes file to disable spam ip visits.

```
//Laravel 10 and below
/*
 * app/Http/Kernel.php
*/

protected $routeMiddleware = [
        .....,
        'abuseip' => \RahulAlam31\LaravelAbuseIp\Middleware\AbuseIp::class,

]

Route::get('/xyz', function () {
    //
})->middleware('abuseip');
```

```
//Laravel 11
/*
 * bootstrap/app.php
*/

->withMiddleware(function (Middleware $middleware) {
    //
})
->aliasMiddleware('abuse_ip', \RahulAlam31\LaravelAbuseIp\Middleware\AbuseIp::class)
```

```
// Or use in route file

Route::middleware(AbuseIp::class)->get('/', function () {
            return view('welcome');
        });
```

### Custom fetches

[](#custom-fetches)

By default the package retrieves a new list by using `file_get_contents()`. If you have your own blacklisted Ip List add it to the `source` in `config/abuseip.php`

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 68.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/767840734c5c1c8a5ae5ccdd00d5d00efad9964126d48ca6b2e0cd9b3c9e43fc?d=identicon)[UnrulyNatives](/maintainers/UnrulyNatives)

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (210 commits)")[![rahulalam31](https://avatars.githubusercontent.com/u/40790503?v=4)](https://github.com/rahulalam31 "rahulalam31 (92 commits)")[![onlime](https://avatars.githubusercontent.com/u/2759561?v=4)](https://github.com/onlime "onlime (3 commits)")[![UnrulyNatives](https://avatars.githubusercontent.com/u/6769986?v=4)](https://github.com/UnrulyNatives "UnrulyNatives (1 commits)")

### Embed Badge

![Health badge](/badges/unrulynatives-laravel-abuse-ip/health.svg)

```
[![Health](https://phpackages.com/badges/unrulynatives-laravel-abuse-ip/health.svg)](https://phpackages.com/packages/unrulynatives-laravel-abuse-ip)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[mews/purifier

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

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41478.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

87117.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[paragonie/hidden-string

Encapsulate strings in an object to hide them from stack traces

7410.6M39](/packages/paragonie-hidden-string)

PHPackages © 2026

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