sonata-project/entity-audit-bundle
Doctrine 2 entity versioning for Symfony, inspired by Hibernate Envers. Tracks changes to audited entities and associations, storing revision history you can browse and compare for full audit trails.
Adopt if:
Look elsewhere if:
"This package lets us automatically track every change to critical data—like a time machine for our database—without writing custom code. For compliance, security, or debugging, we’ll save thousands in dev hours and reduce risks from undetected data corruption. It’s like adding an ‘undo’ button for the entire system, but for auditors. Zero upfront cost, just enable it and start benefiting immediately."
Key Outcomes:
"This is a drop-in Doctrine audit solution that handles the heavy lifting of tracking entity revisions (inserts, updates, deletes) with zero performance overhead during normal operations. It’s battle-tested (used in production by 600+ repos) and integrates seamlessly with Symfony. Here’s how we’ll use it:
User, Order, Payment) in config/packages/entity_audit.yaml.AuditReader (e.g., findRevisions(), find()) to build admin tools./audit) for quick debugging or expose a custom API for frontend integration.updated_at timestamps) via global_ignore_columns.It’s not a silver bullet—you’ll need to handle edge cases (e.g., inheritance, custom primary keys) yourself—but it cuts 80% of the work compared to rolling your own. Tradeoff: Minimal control for maximum speed."
Tech Deep Dive:
_audit tables for each entity, logs revisions with timestamps/usernames via Doctrine events.username_callable for custom auth or override AuditReader for advanced queries.How can I help you explore Laravel packages today?