PHPackages                             larasecure/ip-blocker - 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. larasecure/ip-blocker

ActiveLibrary[Security](/categories/security)

larasecure/ip-blocker
=====================

Restrict access to the web by preventing IP Addresses

v2.2(5y ago)484652[1 PRs](https://github.com/Mahmoud-Italy/Larasecure-ipblocker/pulls)MITPHPPHP ^7.2

Since Jul 22Pushed 5y ago5 watchersCompare

[ Source](https://github.com/Mahmoud-Italy/Larasecure-ipblocker)[ Packagist](https://packagist.org/packages/larasecure/ip-blocker)[ RSS](/packages/larasecure-ip-blocker/feed)WikiDiscussions 2.x Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

IP Blocker
==========

[](#ip-blocker)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/aae8f549b55a5b9526ad1b72ec39375bbef68a119ac582a6b0bef8f627597ee8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61686d6f75642d4974616c792f4c6172615365637572652d4950426c6f636b65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Mahmoud-Italy/LaraSecure-IPBlocker/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/3f6bc10f2cdeaadc41c22a519a23fec7b21ae57d1eb0a7d2ef2e5525a9f167bd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61686d6f75642d4974616c792f4c6172615365637572652d4950426c6f636b65722f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Total Downloads](https://camo.githubusercontent.com/04c89453a090a71930907af9fa4e081edad5923c9e8176d793c3ca56db100ee9/68747470733a2f2f706f7365722e707567782e6f72672f6c6172617365637572652f69702d626c6f636b65722f642f746f74616c2e737667)](https://packagist.org/packages/larasecure/ip-blocker)

[![ib-blocker](ip-blocker.jpg)](ip-blocker.jpg)

A Laravel Package to increase the security of your websites by preventing access for users having blocked IP Addresses.

However, you can add IP Addresses as many as you want into table called ipblockers which you want to disallow access to your site from spam etc.

Installation
============

[](#installation)

```
composer require larasecure/ip-blocker
```

Then publish the config
=======================

[](#then-publish-the-config)

```
php artisan vendor:publish --tag=ipblocker
```

```
php artisan migrate
```

Usage
=====

[](#usage)

Add this middleware in Kernel.php $routeMiddleware to restrict IP Addresses

```
'IPBlocking' => \Larasecure\IPBlocker\Middlewares\IPBlocking::class
```

Add IPBlocking middleware to route group for which you want to restrict access.

```
  Route::group(['middleware' => 'IPBlocking'], function(){
    // you routes..
  });
```

or you can injected in RouteServiceProvider.php

```
  protected function mapApiRoutes()
    {
        Route::prefix('api')
            ->middleware(['api', 'IPBlocking'])
            ->namespace($this->namespace)
            ->group(base_path('routes/api.php'));
    }
```

or just add middleware to single route

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

**Users will be redirect to "403 | Forbidden" page if their IP exist on ipblockers table.**Credits
=======

[](#credits)

- [Mahmoud Italy](https://github.com/Mahmoud-Italy)
- [All Contributors](https://github.com/Mahmoud-Italy/Larasecure-ipblocker/graphs/contributors)

License
=======

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

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

Total

3

Last Release

2157d ago

Major Versions

v1.0.0 → v2.22020-07-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17962343?v=4)[Mahmoud Ahmed](/maintainers/Mahmoud-Italy)[@Mahmoud-Italy](https://github.com/Mahmoud-Italy)

---

Top Contributors

[![Mahmoud-Italy](https://avatars.githubusercontent.com/u/17962343?v=4)](https://github.com/Mahmoud-Italy "Mahmoud-Italy (26 commits)")

---

Tags

ipblockerslarasecurelaravellumen

### Embed Badge

![Health badge](/badges/larasecure-ip-blocker/health.svg)

```
[![Health](https://phpackages.com/badges/larasecure-ip-blocker/health.svg)](https://phpackages.com/packages/larasecure-ip-blocker)
```

###  Alternatives

[mews/purifier

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

2.0k18.7M142](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k37](/packages/paragonie-ecc)

PHPackages © 2026

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