PHPackages                             bernskiold/laravel-data-scrubber - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. bernskiold/laravel-data-scrubber

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

bernskiold/laravel-data-scrubber
================================

A package for Laravel to clean or scrub data such as PII from models.

0.1.0(3mo ago)01MITPHPPHP ^8.2CI passing

Since Jan 17Pushed 3mo agoCompare

[ Source](https://github.com/bernskiold/laravel-data-scrubber)[ Packagist](https://packagist.org/packages/bernskiold/laravel-data-scrubber)[ Docs](https://github.com/bernskiold/laravel-data-scrubber)[ RSS](/packages/bernskiold-laravel-data-scrubber/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Laravel Data Scrubber
=====================

[](#laravel-data-scrubber)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bccb8378c72870e34c488411af78762f5ee5ccc592e936b2aba8584ecf7620c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6265726e736b696f6c642f6c61726176656c2d646174612d73637275626265722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bernskiold/laravel-data-scrubber)[![GitHub Tests Action Status](https://camo.githubusercontent.com/2542f388bc93a50ec9ad7a03af9e83f80e751c67598f4cf4e06d143e4736185e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6265726e736b696f6c642f6c61726176656c2d646174612d73637275626265722f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/bernskiold/laravel-data-scrubber/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c6580a5c2babd6af3b4744492f9ce8bc16acfb1231ddb8dea6199697b5fe94a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6265726e736b696f6c642f6c61726176656c2d646174612d73637275626265722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bernskiold/laravel-data-scrubber)

A Laravel package for scrubbing PII (Personally Identifiable Information) and sensitive data from Eloquent models. Useful for GDPR compliance and data retention policies.

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

[](#installation)

Install the package via composer:

```
composer require bernskiold/laravel-data-scrubber
```

Optionally publish the configuration file:

```
php artisan vendor:publish --provider="Bernskiold\LaravelDataScrubber\DataScrubberServiceProvider" --tag="config"
```

If you're using [Laravel Horizon](https://laravel.com/docs/horizon), add the `data-scrubber` queue to your `config/horizon.php`:

```
'environments' => [
    'production' => [
        'supervisor-1' => [
            'queues' => ['default', 'data-scrubber'],
            // ...
        ],
    ],
],
```

Usage
-----

[](#usage)

### Implementing Scrubbable on a Model

[](#implementing-scrubbable-on-a-model)

To make a model scrubbable, implement the `Scrubbable` interface and use the `ScrubsData` trait:

```
