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
Auditor Doctrine Provider

Auditor Doctrine Provider Laravel Package

damienharper/auditor-doctrine-provider

Doctrine ORM provider for DamienHarper/auditor. Automatically records audit logs for Doctrine entities (create/update/delete) with DBAL/ORM integration and configurable auditing, making change tracking and accountability easy in PHP applications.

View on GitHub
Deep Wiki
Context7

Doctrine ORM provider for the auditor audit-log library.

Frequently asked questions about Auditor Doctrine Provider
How do I install this package in a Laravel project using Doctrine ORM?
Run `composer require damienharper/auditor-doctrine-provider` and ensure you have Doctrine ORM (v3.2+) and the base `auditor` package (v4.0+) installed. Configure the provider in your Doctrine setup by registering it as an event subscriber for your entities.
Does this work with Laravel Eloquent models?
No, this package is specifically for Doctrine ORM entities. If you're using Eloquent, consider alternatives like `spatie/laravel-activitylog` or build a custom solution with model observers.
What Laravel versions are supported?
This package doesn’t directly depend on Laravel—it requires Doctrine ORM (v3.2+), which works with Laravel via `laravel-doctrine/orm`. Ensure your Laravel version supports Doctrine ORM integration (typically Laravel 8+).
How does the 1.2.0 fix for OneToMany associations improve reliability?
The fix ensures inverse-side associations (e.g., `OrderItem → Order`) are fully audited during batch operations, preventing missed `ASSOCIATE` entries. This is critical for complex relationships where parent-child reassignments might otherwise go unlogged.
Can I customize audit log fields like `audited_by` or `reason`?
Yes, you can configure custom metadata via Doctrine annotations or YAML. The package supports adding fields like `audited_by` (user ID) or `reason` (change justification) to enrich audit entries.
Will this impact performance in high-traffic applications?
Audit logging adds database writes on entity changes. The 1.2.0 fix may slightly increase writes during batch operations. Mitigate this by using async logging (e.g., Laravel queues) or benchmarking under production-like loads.
How do I store audit logs in a separate database or Elasticsearch?
By default, logs use the same database as your entities. To extend storage, override the `AuditLogger` interface or configure a custom writer to forward logs to Elasticsearch or another system.
Are there alternatives for Laravel projects not using Doctrine ORM?
For Eloquent-based projects, use `spatie/laravel-activitylog` or build a custom solution with model events. If you’re already using Doctrine, this package is a lightweight, event-driven alternative to manual logging.
How do I test audit logs in a CI pipeline?
Mock Doctrine events in your tests (e.g., `prePersist`, `preUpdate`) and verify audit entries via repository queries. Use the package’s `AuditLogger` interface to assert logged changes without hitting a real database.
What happens if I upgrade Doctrine ORM in the future?
The package targets Doctrine ORM v3.2+, so minor upgrades are unlikely to break compatibility. Monitor the `auditor` and `auditor-doctrine-provider` changelogs for major version requirements and test thoroughly after upgrades.
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.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony