- How do I install webnet-fr/database-anonymizer in a Laravel app?
- Install it with Composer using composer require webnet-fr/database-anonymizer, then publish the package config so you can define your table and column rules. Because the package is pre-1.0, confirm the illuminate/* and PHP constraints in composer.json before installing into an existing Laravel app. Run the package's Artisan anonymization command only against a disposable or backed-up database copy.
- Does webnet-fr/database-anonymizer support Laravel 10 and Laravel 11?
- Laravel 10 and 11 support is not proven by the package description alone; the illuminate/* constraints in composer.json are the real gate. The doctrine/dbal ^3.3 floor is a positive signal because it aligns with schema operations used by modern Laravel lines, but it is not a compatibility guarantee. Test installation and the anonymization command in a spike on your exact Laravel and PHP versions before adopting.
- How do I configure per-table and per-column anonymization rules?
- Rules live in the package's publishable config file, where you map each table to the columns you want replaced. Each column entry points to a Faker-based anonymizer or a closure, so unrelated tables and columns are left intact. Keep the config in version control so data-classification owners can review changes like code.
- Can I use Faker to generate fake names, emails, and addresses?
- Yes. Faker-based rules let you overwrite names, emails, addresses, and similar personal data with realistic fake values. Use them for common PII shapes where realistic but non-real output is enough. For domain-specific identifiers, pair Faker rules with custom closures.
- How do I write a custom closure anonymizer for a column?
- Define a closure in the column rule and return the replacement value you want written back to the database. Closures are the escape hatch for identifiers Faker cannot model, such as account numbers or internal customer keys. If you rely on seedable runs, keep closure output deterministic or derive it from a stable seed.
- Does doctrine/dbal let it detect unmapped PII columns?
- The doctrine/dbal dependency may allow the package to inspect real column metadata, which could support detecting columns that have no rule. That behavior is inferred from the dependency changelog, not confirmed in the overview, so treat it as a hypothesis. The highest-value spike test is whether the tool flags PII-shaped columns that your config does not cover; silent under-coverage is the main risk to control.
- How does it handle referential integrity and foreign keys?
- Referential integrity is not guaranteed by the rule list alone. Test composite keys, polymorphic relations, and nullable foreign keys explicitly if your schema depends on consistent IDs across tables. Use the seedable fake data feature where repeatable values matter, and add your own assertions around relationships before trusting the output.
- Is fake data consistent across runs when I seed Faker?
- Yes, the package advertises consistent, seedable fake data across runs. That matters when you need repeatable staging data or test fixtures that look the same between rebuilds. Confirm how the seed is configured in your published config and keep it stable in shared environments.
- Is the in-place Artisan anonymization command safe to run in production?
- The Artisan command anonymizes a database in place, so run it only on a production dump restored into a controlled staging or local environment. Take a backup and restrict credentials before the first run. Do not point it at a live production database, because overwriting personal data is irreversible.
- Is webnet-fr/database-anonymizer maintained and safe as a PII control?
- Treat it as a pre-1.0, single-maintainer package: v0.0.6 has no semver guarantee for config schema or anonymizer contract changes, and releases are intermittent rather than dormant. Because it acts as a PII control, a bug is a data incident rather than a cosmetic failure. Mitigate with a named owner, a vendored fork if needed, and a quarterly upstream diff; the doctrine/dbal floor adds a dependency upgrade treadmill to track.