- Does herdwatch/entity-audit-bundle work with Laravel?
- No, not natively. It is a Symfony bundle built around Doctrine ORM, with bundle registration, a DI extension, compiler passes, and Doctrine event subscribers for onFlush and postFlush auditing. Laravel has no equivalent bundle bootstrap or doctrine.orm.entity_manager alias to hook into. Using it would mean adopting laravel-doctrine/orm and hand-wiring the services, which is a bespoke integration rather than a supported path.
- How do I install herdwatch/entity-audit-bundle?
- Install it with Composer and register the bundle in a Symfony kernel, then configure the Doctrine connection and entity manager. It is not installed through Laravel package discovery. You also need the shadow audit tables created for each audited entity. Check the package README and upstream simplethings/EntityAuditBundle documentation for the exact service and configuration wiring.
- What does EntityAuditBundle actually record?
- It records create, update, and delete events for Doctrine entities, including field-level change history and user attribution. Changes are stored in shadow audit tables keyed by a revision number. The result is a queryable trail for debugging, compliance, and accountability.
- Is LGPL-2.1 a problem for a commercial Laravel app?
- Possibly. LGPL-2.1 is a material step away from the MIT and Apache licenses common in the Laravel ecosystem, and static inclusion in a distributed PHP application raises copyleft questions. This needs legal sign-off, especially if you ship on-prem or as a packaged product. Choosing a native MIT-licensed auditing package avoids the issue entirely.
- What are the best Laravel alternatives to this Doctrine audit bundle?
- owen-it/laravel-auditing is the mature, MIT-licensed, Eloquent-native option and covers roughly 80 percent of the same functional surface. A thin in-house audits table populated by model observers inside the same database transaction is also viable. Both avoid Symfony and Doctrine wiring and the LGPL review. Add a revision_id column if you need grouped changesets.
- Does the audit listener affect application performance?
- Yes. An onFlush listener that computes per-entity diffs adds latency to every persisted unit of work. Audit revision tables also grow without bound unless you own partitioning and retention. Estimate audit-row volume per year and set a retention window before rolling it out.
- Can an audit failure break the main business transaction?
- Yes, by design. Audit writes happen inside the same transaction as the business write, which is correct for compliance because it prevents silent audit gaps. The downside is that schema drift, a missing audit table for a newly added entity, or a column type mismatch can fail the business transaction. Keep audit migrations tightly coupled to entity migrations.
- How does this handle GDPR right to be forgotten with immutable audit tables?
- Immutable revision tables conflict directly with erasure requests, so you need a documented redaction strategy. Decide what personal data is captured in old_values and new_values and whether you can redact or crypto-shred it. Clarify whether the compliance driver is GDPR, SOX, HIPAA, or internal forensics. Do not assume deleting the entity also deletes its audit history.
- Is herdwatch/entity-audit-bundle actively maintained?
- It is a downstream fork of simplethings/EntityAuditBundle with 0 stars, 0 dependents, and single-vendor backing, so the bus factor is effectively 1. Its real value depends on the diff against upstream and whether it tracks upstream commits. Without that visibility, unmerged or divergent changes become a long-term upgrade tax. Assess maintenance risk before relying on it for every write path.
- Can I use this package just for the audit table schema in Laravel?
- You can borrow the design without using the code. The revision table plus insert, update, and delete semantics are simple to replicate in Eloquent with an append-only audits table, old_values, new_values, actor_id, request_id, and a revision_id column for grouped changesets. Keep the observer writes inside the same database transaction as the business write. That gives you the useful audit pattern without Doctrine or Symfony service wiring.