PHPackages                             rahulalam31/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. [Framework](/categories/framework)
4. /
5. rahulalam31/laravel-abuse-ip

ActiveLibrary[Framework](/categories/framework)

rahulalam31/laravel-abuse-ip
============================

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

1.4(1y ago)27431.5k↓26.5%28[3 issues](https://github.com/rahulalam31/Laravel-Abuse-IP/issues)[2 PRs](https://github.com/rahulalam31/Laravel-Abuse-IP/pulls)MITPHPPHP ^8.0CI passing

Since Jul 23Pushed 1mo ago6 watchersCompare

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

READMEChangelog (7)Dependencies (12)Versions (8)Used By (0)

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

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

49

—

FairBetter than 95% of packages

Maintenance65

Regular maintenance activity

Popularity48

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.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 ~5 days

Total

7

Last Release

636d ago

Major Versions

0.02 → 1.02024-07-24

### Community

Maintainers

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

---

Top Contributors

[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (616 commits)")[![rahulalam31](https://avatars.githubusercontent.com/u/40790503?v=4)](https://github.com/rahulalam31 "rahulalam31 (93 commits)")[![onlime](https://avatars.githubusercontent.com/u/2759561?v=4)](https://github.com/onlime "onlime (3 commits)")[![corean](https://avatars.githubusercontent.com/u/225376?v=4)](https://github.com/corean "corean (1 commits)")

---

Tags

frameworklaravelLaravel Securityspam protectionabuseipdb

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k10.6M274](/packages/laravel-boost)[laravel/lumen-framework

The Laravel Lumen Framework.

1.5k26.2M709](/packages/laravel-lumen-framework)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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