Quickstart
Quickstart
- Install the package
composer require padosoft/laravel-pii-redactor - Publish configuration when you need to change defaults
php artisan vendor:publish --tag=pii-redactor-config - Redact text through the facade
use Padosoft\PiiRedactor\Facades\Pii; $text = 'IBAN IT60X0542811101000000123456, email mario@example.com.'; $redacted = Pii::redact($text); - Inspect detections before replacing content
$report = Pii::scan('Telefono +39 333 1234567 e P.IVA 12345678903.'); $counts = $report->countsByDetector();
Default scope
The default configuration loads the international detectors and ItalyPack. Add Germany or Spain explicitly when the host application processes those jurisdictions.
First useful configuration
PII_REDACTOR_ENABLED=true
PII_REDACTOR_STRATEGY=mask
PII_REDACTOR_MASK_TOKEN=[REDACTED]
PII_REDACTOR_AUDIT_TRAIL=false
For reversible pseudonymisation, switch to tokenise, set PII_REDACTOR_SALT, choose a persistent token store, and run the migration if the database driver is selected.