Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Entity Audit Bundle

Entity Audit Bundle Laravel Package

herdwatch/entity-audit-bundle

Herdwatch EntityAuditBundle adds automatic audit logging to Doctrine entities in Symfony apps. Track who changed what and when, store field-level diffs, and review a complete history of inserts, updates, and deletes without cluttering your domain code.

View on GitHub
Deep Wiki
Context7

herdwatch/entity-audit-bundle adds transparent audit logging to your PHP entities. Every create, update, and delete is captured with a full record of changed fields, so you always know who changed what, and when—without cluttering domain code with manual logging.

It hooks into your persistence layer to store before/after values, timestamps, and the acting user in a dedicated audit table. Lightweight and framework-friendly, it drops into existing applications with minimal configuration.

  • Automatic create, update, and delete tracking
  • Per-field old/new value diffs for precise history
  • User attribution and accurate timestamps out of the box
  • Queryable audit trail stored in a dedicated table
  • Zero-friction setup with sensible defaults
Frequently asked questions about Entity Audit Bundle
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.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo