PHPackages                             directorytree/anonymize - 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. directorytree/anonymize

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

directorytree/anonymize
=======================

Anonymize sensitive model data with realistic fake data using Faker

v1.1.1(8mo ago)1079.2k↓28.6%MITPHPPHP ^8.2CI passing

Since Aug 6Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/DirectoryTree/Anonymize)[ Packagist](https://packagist.org/packages/directorytree/anonymize)[ RSS](/packages/directorytree-anonymize/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (11)Used By (0)

Anonymize
=========

[](#anonymize)

[![Latest Version on Packagist](https://camo.githubusercontent.com/098463a9c685d17b0d0afb747ae832f527cd78500c451e5ca197c86e698c3f95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6469726563746f7279747265652f616e6f6e796d697a652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/directorytree/anonymize)[![Tests](https://camo.githubusercontent.com/59a76843320e0aa866337b214f3ac353c9da13bf13a0c34e0972fd4df021a17f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4469726563746f7279547265652f416e6f6e796d697a652f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/DirectoryTree/Anonymize/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/dd8482213aa92ad86a0d7d982370339e97b30640af0ee5e3cfdd54003ed8c15a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6469726563746f7279747265652f616e6f6e796d697a652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/directorytree/anonymize)

Anonymize replaces sensitive model data with realistic fake data using Faker. Perfect for development environments, demos, and data sharing scenarios where you need to protect user privacy while maintaining data structure and relationships.

Features
--------

[](#features)

- **Privacy-First**: Automatically anonymize sensitive model attributes
- **Consistent Data**: Same model ID always generates the same fake data
- **Seamless Integration**: Works transparently with existing Eloquent models
- **Granular Control**: Enable/disable anonymization globally or per-model instance
- **Performance Optimized**: Intelligent caching prevents redundant fake data generation

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Laravel &gt;= 11

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

[](#installation)

You can install the Anonymize using Composer:

```
composer require directorytree/anonymize
```

Usage
-----

[](#usage)

### Set Up Your Model

[](#set-up-your-model)

Implement the `Anonymizable` interface and use the `Anonymized` trait on your Eloquent model.

Then, define the attributes you want to anonymize in the `getAnonymizedAttributes()` method:

```
