PHPackages                             cschalenborgh/laravel-ip-anonymizer - 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. cschalenborgh/laravel-ip-anonymizer

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

cschalenborgh/laravel-ip-anonymizer
===================================

IPv4 and IPv6 address anonymizer for Laravel

1.0.6(7y ago)632.8k↓20%2MITPHPPHP &gt;=7.1

Since Apr 30Pushed 6y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (8)Used By (2)

Ip Anonymizer package for Laravel
=================================

[](#ip-anonymizer-package-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6088738b2c14814eed7366a8381609a41775ed2a3b3330afe5df42a9628148a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63736368616c656e626f7267682f6c61726176656c2d69702d616e6f6e796d697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cschalenborgh/laravel-ip-anonymizer)[![Build Status](https://camo.githubusercontent.com/3a9a7a43f29ca624fdd95a05d850e8ec92c1a634ad05ec74b50cfa9e95448bcc/68747470733a2f2f7472617669732d63692e6f72672f63736368616c656e626f7267682f6c61726176656c2d69702d616e6f6e796d697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/cschalenborgh/laravel-ip-anonymizer)[![Code Coverage (GitHub)](https://camo.githubusercontent.com/ae1e483d99dc3e32a7685080597257a8ec8aad63983a76f3bba758b277029e9f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f63736368616c656e626f7267682f6c61726176656c2d69702d616e6f6e796d697a6572)](https://camo.githubusercontent.com/ae1e483d99dc3e32a7685080597257a8ec8aad63983a76f3bba758b277029e9f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f63736368616c656e626f7267682f6c61726176656c2d69702d616e6f6e796d697a6572)[![StyleCI](https://camo.githubusercontent.com/4e1fe010021dd81fe72e05d7457b0b45ac7921fbfc059cd67bd7dc8b08ecf74d/68747470733a2f2f7374796c6563692e696f2f7265706f732f3138343333393933372f736869656c64)](https://styleci.io/repos/184339937)[![Total Downloads](https://camo.githubusercontent.com/28e35325f9fcf47a49cd055f42231d4b5cdd3e0e78022f80a3ebbb37b1595953/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63736368616c656e626f7267682f6c61726176656c2d69702d616e6f6e796d697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cschalenborgh/laravel-ip-anonymizer)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Description
===========

[](#description)

You can use this package to easily anonymize IP addresses in your Laravel application. Requires PHP 7.1 or higher.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require cschalenborgh/laravel-ip-anonymizer
```

The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:

```
'providers' => [
    // ...
    Cschalenborgh\IpAnonymizer\IpAnonymizerServiceProvider::class,
];
```

Usage
-----

[](#usage)

```
echo IpAnonymizer::anonymizeIp('133.242.241.12');
// returns 133.242.241.0
```

```
echo IpAnonymizer::anonymizeIp('133.242.241.12', '255.255.0.0');
// returns 133.242.0.0
```

```
echo IpAnonymizer::anonymizeIp('2001:db8:85a3::1319:8a2e:370:7344', 'ipv6');
// returns 2001:db8:85a3::
```

```
echo IpAnonymizer::anonymizeIp('2001:db8:85a3::1319:8a2e:370:7344', 'ipv6', 'ffff:ffff:0000:0000:0000:0000:0000:0000');
// returns 2001:db8::
```

```
echo (new IpAnonymizer())->anonymizeIPv4('133.242.241.12');
// returns 133.242.241.0

echo (new IpAnonymizer())->anonymizeIPv4('133.242.241.12', '255.0.0.0');
// returns 133.0.0.0

echo (new IpAnonymizer())->anonymizeIPv6('2001:db8:85a3::1319:8a2e:370:7344');
// returns 2001:db8:85a3::

echo (new IpAnonymizer())->anonymizeIPv6('2001:db8:85a3::1319:8a2e:370:7344', 'ffff:ffff:0000:0000:0000:0000:0000:0000');
// returns 2001:db8::
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

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

Total

7

Last Release

2574d ago

### Community

Maintainers

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

---

Top Contributors

[![cschalenborgh](https://avatars.githubusercontent.com/u/10864861?v=4)](https://github.com/cschalenborgh "cschalenborgh (25 commits)")

---

Tags

laravelgdpranonymizerip-anonymizer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cschalenborgh-laravel-ip-anonymizer/health.svg)

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

###  Alternatives

[whitecube/laravel-cookie-consent

Register, configure and ask for cookies consent in a EU-compliant way.

489563.9k1](/packages/whitecube-laravel-cookie-consent)[statikbe/laravel-cookie-consent

Cookie consent modal for EU

213396.7k](/packages/statikbe-laravel-cookie-consent)[scify/laravel-cookie-guard

A Laravel package that provides a Cookies consent floating window and publishes the Cookies for the different consent categories

13714.3k](/packages/scify-laravel-cookie-guard)

PHPackages © 2026

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