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.
damienharper/auditor-doctrine-provider) remains well-aligned for Doctrine ORM-based audit logging, particularly for CRUD-heavy applications requiring fine-grained change tracking (e.g., compliance, financial systems). The 1.2.0 fix for inverse-side OneToMany associations addresses a critical gap in audit completeness, making it more reliable for complex entity relationships (e.g., Order ↔ OrderItem).laravel-doctrine/orm.OneToMany associations when multiple entities are flushed together (previously missed some ASSOCIATE entries).audited_by, reason) via annotations/YAML.prePersist, preUpdate, etc.), but the fix reduces edge-case inconsistencies.laravel-doctrine/orm).OrderItem → Order) might not be fully audited when multiple entities are saved in a batch.ASSOCIATE operations (e.g., reparenting OrderItem to a new Order) could be missed. Now, these are consistently logged.| Risk Area | Description | Mitigation Strategy |
|---|---|---|
| ORM Mismatch | Laravel’s Eloquent ≠ Doctrine ORM; requires additional setup. | Use laravel-doctrine/orm or hybrid architecture. |
| Performance Overhead | Audit logging adds DB writes on every entity change. Fixed bug may increase writes slightly during batch operations. | Benchmark with production-like loads; use async logging (e.g., queues) if needed. |
| Schema Changes | May require new tables for audit logs (e.g., audit_entries). Bug fix may alter log structure for associations. |
Design schema upfront; test migrations thoroughly. |
| Event Conflicts | Doctrine events may clash with existing listeners. Bug fix reduces but doesn’t eliminate this risk. | Test in isolation; prioritize event binding order. |
| Maintenance Burden | Package is niche (2 stars, low activity). No breaking changes in 1.2.0, but long-term viability remains uncertain. | Monitor for updates; consider forking if critical. |
observers or model events suffice? (Unchanged)OneToMany inverse-side changes)? If so, the 1.2.0 fix is critical.spatie/laravel-activitylog for Eloquent)? (Unchanged)laravel-doctrine/orm).spatie/laravel-activitylog.Order ↔ OrderItem for association testing).doctrine/orm and laravel-doctrine/orm.composer require damienharper/auditor-doctrine-provider:^1.2
OneToMany changes (e.g., reparenting OrderItem) are logged.$order1 = new Order();
$order2 = new Order();
$item = new OrderItem();
$item->setOrder($order1); // Audit should log ASSOCIATE for $order1
$item->setOrder($order2); // Audit should now correctly log ASSOCIATE for $order2 (fixed in 1.2.0)
Order ↔ OrderItem) to validate the 1.2.0 fix.$auditLog = $auditor->fetchAuditLog(OrderItem::class, $itemId);
config/app.php.OneToMany relationship (e.g., Order ↔ OrderItem).$auditor->fetchAuditLog() to verify association logs.How can I help you explore Laravel packages today?