php-shark-tank/anonymizer-bundle
Symfony bundle for anonymizing sensitive data before storage or sharing. Helps mask personal information in entities and datasets so applications can meet privacy and GDPR requirements with less custom code.
The 1.0.0 release is a Symfony bundle for the framework-agnostic PHPSharkTank/Anonymizer library — it is not a Laravel package and will not be auto-discovered by a Laravel app. What you actually consume in Laravel is the core anonymizer library; the bundle is best read as a reference implementation showing the three wiring points the core exposes: a Loader (metadata discovery), ExclusionStrategies (which entities/properties to skip), and a Cache (for loader metadata).
composer require phpsharktank/anonymizer. Do not install the Symfony bundle expecting it to register services in Laravel.DependencyInjection/Extension and its config/packages/anonymizer.yaml — the three toggles (cache, loader, exclusion_strategies) map directly to the three extension points you must bind in a Laravel service provider.AppServiceProvider, load metadata once, and call it from a queued job or console command.Loader, ExclusionStrategyManager) as singletons in a dedicated AnonymizerServiceProvider. Mirror the bundle's three booleans as entries in config/anonymizer.php driven by env(), so you can flip caching/loader/strategies per environment just like the Symfony bundle.register() and resolving lazily so tests can swap it.#[DoNotAnonymize] marker.Cache::store(). Enable in staging/production; disable in local and in tests. Key the cache on the loader class + schema version so redeploys invalidate cleanly.php artisan anonymizer:run command or a queued job that chunk-reads models and writes anonymized rows — never load a whole table into memory.tap() hook on your logging channel.composer require the Symfony bundle in a Laravel app and expect service wiring. The toggles are bundle-specific; replicate them in Laravel config yourself.local.phpunit.xml, bind an in-memory cache, and assert anonymized output for each entity type. Snapshot-test the anonymized DTOs so regressions in strategy order are caught.Loader (e.g. Eloquent model introspection), a custom ExclusionStrategy (tenant/role), and a custom cache adapter (Laravel cache repository) are the three you'll most likely write — start there rather than porting the whole bundle.How can I help you explore Laravel packages today?