PHPackages                             mares29/laravel-ip-filter - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. mares29/laravel-ip-filter

ActiveLibrary[HTTP &amp; Networking](/categories/http)

mares29/laravel-ip-filter
=========================

Filter request by IP addresses for Laravel

1.2(7y ago)212.9k↓33.3%1[1 issues](https://github.com/mares29/laravel-ip-filter/issues)MITPHP

Since Jan 31Pushed 7y ago1 watchersCompare

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

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

IP Filter for Laravel 5 Application
===================================

[](#ip-filter-for-laravel-5-application)

This package provide simple way to filter user access by IP addresses for your Laravel 5 application.

Install
-------

[](#install)

Via Composer

```
$ composer require mares29/laravel-ip-filter
```

Laravel 5.5+ automaticly register service provider and set Alias thanks to auto-discovery. With lower laravel version add to **app.php**

```
'providers' => [
	\Mares29\Breadcrumb\FilterIpServiceProvider::class,
]
```

Usage
-----

[](#usage)

Export filter config.

```
php artisan vendor:publish --provider="Mares29\IpFilter\FilterIpServiceProvider"

```

By default the filter is active only on **production** environment, but you can specify Your own settings in config file.

```
	// Env - only use filter on listed environments
	'env' => ['production'],
```

Use one of **black list** or **white list** method. For example, allow acces only from ip address *127.0.0.1*.

```
	// White list - List of allowed IP addresses
	'allowed' => [
		'127.0.0.1'
	],

	// Black list - List of denied IP addresses
	'denied' => [],
```

Add middleware for all Your web routes.

```
protected function mapWebRoutes()
    {
        Route::middleware('web')
             ->middleware('filterIp')
             ->namespace($this->namespace)
             ->group(base_path('routes/web.php'));
    }
```

Or just for specific routes.

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

Credits
-------

[](#credits)

- [Karel Mares](https://github.com/mares29)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity66

Established project with proven stability

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 ~83 days

Total

4

Last Release

2772d ago

Major Versions

0.1 → 1.02018-01-31

### Community

Maintainers

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

---

Tags

ipfilterlaravellaravel-5-packagelaravel-middlewarelaravel5middlewarelaravelmares29filter-ip-address

### Embed Badge

![Health badge](/badges/mares29-laravel-ip-filter/health.svg)

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

###  Alternatives

[matthewbdaly/laravel-etag-middleware

A Laravel middleware for adding ETags to HTTP requests to improve response times

64326.0k2](/packages/matthewbdaly-laravel-etag-middleware)[tomschlick/request-migrations

HTTP Request Migrations

1844.5k](/packages/tomschlick-request-migrations)[softonic/laravel-middleware-request-id

Middleware for Laravel Framework to add the X-Request-ID header in the requests and responses.

15106.9k](/packages/softonic-laravel-middleware-request-id)[shin1x1/laravel-force-https-url-scheme

Force https url schema middleware for Laravel 5

2726.6k](/packages/shin1x1-laravel-force-https-url-scheme)[brightfish/caching-guzzle

Cache HTTP responses through Guzzle middleware

1031.5k](/packages/brightfish-caching-guzzle)

PHPackages © 2026

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