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 History Bundle

Entity History Bundle Laravel Package

bobv/entity-history-bundle

View on GitHub
Deep Wiki
Context7

Keep the history of your Doctrine objects

Frequently asked questions about Entity History Bundle
Can I use EntityHistoryBundle with Laravel’s Eloquent ORM instead of Doctrine?
No, this bundle is designed for Doctrine ORM only. If you’re using Eloquent, you’ll need a custom solution like observers or a package like spatie/laravel-activitylog, which supports Eloquent natively.
What Laravel versions are supported by this bundle?
The bundle itself is Symfony-focused, but it works with Laravel via fruitcake/laravel-doctrine. Ensure your Laravel version (8.x–10.x) aligns with the Doctrine ORM version supported by fruitcake’s bridge.
How do I configure EntityHistoryBundle to track specific fields or ignore sensitive data?
Use annotations (`@History`) or YAML configuration to define which fields to track. Exclude sensitive fields by omitting them from the configuration or overriding the `getHistoryFields()` method in your entity.
Will this bundle slow down my application if I enable history tracking for high-traffic entities?
Yes, history writes are synchronous and transactionally coupled to entity operations. For high-write systems, consider batching writes or using a queue system to decouple history logging from the main transaction.
Does EntityHistoryBundle support querying historical data by date range or specific changes?
Basic queries are supported via the generated history table (e.g., filtering by `changed_at`). Advanced time-travel queries or diffs require custom repository methods or raw SQL, as the bundle doesn’t include a query builder.
How do I migrate from a version before 4.3.1 to the latest release? Are there breaking changes?
The 4.3.1 fix resolves a primary key constraint issue in the history table, which is non-breaking for upgrades. Run `php artisan doctrine:schema:validate` post-upgrade to verify schema integrity. No data migration is required.
Can I use EntityHistoryBundle for regulatory compliance where immutable audit trails are required?
The bundle provides a basic audit trail but lacks features like user attribution or cryptographic hashing for immutability. For strict compliance, extend the bundle with custom logic or pair it with a dedicated audit package.
How do I test history tracking in Laravel’s PHPUnit tests without hitting the database?
Mock Doctrine events using PHPUnit’s mock builder or a container like Mockery. Override the event dispatcher in your test setup to intercept `preUpdate`/`prePersist` events and assert history records programmatically.
Is there a way to backfill history for existing entities after installation?
No, the bundle doesn’t include backfill tools. You’ll need a custom script to query existing entities, serialize their data, and insert records into the history table manually.
What are the alternatives to EntityHistoryBundle for Laravel if I don’t want to use Doctrine ORM?
For Eloquent, consider `spatie/laravel-activitylog` for flexible activity tracking or `owen-it/laravel-auditing` for simpler audit logs. For event sourcing, explore `spatie/laravel-event-sourcing` or custom solutions with Laravel’s queue system.
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