Weave Code
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 Laravel Package

simplethings/entity-audit-bundle

Doctrine 2 auditing/versioning bundle inspired by Hibernate Envers. Tracks entity changes and associations over time, stores revisions, and lets you inspect historical states for debugging, compliance, and change history in Symfony/Doctrine apps.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Compliance & Governance: Enables automated tracking of entity changes for audit trails, critical for industries like healthcare (HIPAA), finance (SOX), or legal (GDPR).
  • Debugging & Rollback: Facilitates debugging by allowing developers to inspect historical states of entities, reducing downtime during incidents.
  • Feature Roadmap: Supports "time-travel" features (e.g., "Show me how this record looked 3 months ago") for admin dashboards or reporting tools.
  • Build vs. Buy: Avoids reinventing audit logging wheels, reducing dev time and maintenance overhead compared to custom solutions.
  • Use Cases:
    • Regulatory Compliance: Automatically log changes to sensitive data (e.g., user profiles, financial records).
    • Data Integrity: Track who modified what and when to prevent unauthorized changes.
    • Analytics: Analyze trends by querying historical entity states (e.g., "How many orders were canceled last month?").
    • Disaster Recovery: Revert entities to previous states if corrupted or accidentally altered.

When to Consider This Package

  • Adopt if:

    • Your application requires immutable audit logs for critical entities (e.g., user data, transactions).
    • You’re using Symfony/Laravel with Doctrine ORM and need a lightweight, battle-tested solution.
    • Your team lacks bandwidth to build a custom audit system from scratch.
    • You need association tracking (e.g., auditing changes to related entities like orders and customers).
    • Your stack supports PHP 8.2+ and Symfony 8+ (or standalone Doctrine).
  • Look elsewhere if:

    • You need real-time audit streaming (e.g., Kafka-based event sourcing) instead of periodic snapshots.
    • Your database schema is highly dynamic (e.g., NoSQL or schema-less systems).
    • You require fine-grained field-level auditing (e.g., tracking individual array elements in JSON columns) without custom extensions.
    • Your team prefers event sourcing over snapshot-based auditing (e.g., using libraries like spatie/laravel-activitylog for event-based logs).
    • You’re using Joined-Table Inheritance (this package has limited support).
    • You need multi-database support (e.g., PostgreSQL + MySQL) without additional configuration.

How to Pitch It (Stakeholders)

For Executives:

"This package automates compliance and reduces risk by creating an unalterable log of every change to critical data—like a ‘black box’ for your database. For example, if a customer disputes a charge, we can instantly prove what their account looked like at the time of the transaction. It’s like adding a time machine to your data, which cuts audit prep time by 70% and eliminates manual logging errors. The cost? Minimal—just a few lines of config and zero ongoing maintenance. Industries like finance and healthcare already use this to pass compliance checks effortlessly."

For Engineers:

*"This is a drop-in Doctrine extension that mirrors your entity tables with revision history (e.g., users_audit). It hooks into Doctrine’s lifecycle to auto-track inserts, updates, and deletes, including associations. Key perks:

  • Zero code changes: Just configure which entities to audit in config/packages/entity_audit.yaml.
  • Query historical states: Fetch any entity’s past version with $auditReader->find(Entity::class, $id, $revision).
  • Built-in UI: Get a ready-made /audit dashboard to browse revisions (secure it with Symfony’s security system).
  • Lightweight: Adds ~50KB to your bundle and runs in the background. Tradeoff: It’s not real-time (uses snapshots), but it’s 10x faster to implement than a custom solution and handles edge cases like associations out of the box."*

For Data Teams:

*"This gives you SQL-based audit trails without ETL overhead. Need to analyze how a field changed over time? Query the _audit tables directly or use the AuditReader to compare revisions. For example:

$revisions = $auditReader->findRevisions(User::class, 42); // Get all changes for user #42
$changesAtRev10 = $auditReader->findEntitiesChangedAtRevision(10); // See what changed in bulk

It’s like git for your database—except you can’t git reset --hard by accident."*

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky