kachnitel / auditor-bundle
Fork of damienharper/auditor-bundle with additional features (AuditContext, AuditReader, Snapshot, EventAuditService, admin integration).
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 132
Open Issues: 1
Type:symfony-bundle
pkg:composer/kachnitel/auditor-bundle
Requires
- php: >=8.2
- damienharper/auditor: ^3.2
- doctrine/doctrine-bundle: ^2.0|^3.0
- doctrine/orm: ^3.1
- symfony/doctrine-bridge: ^5.4|^6.4|^7.0
- symfony/event-dispatcher: ^5.4|^6.4|^7.0
- symfony/lock: ^5.4|^6.4|^7.0
- symfony/security-bundle: ^5.4|^6.4|^7.0
Requires (Dev)
- gedmo/doctrine-extensions: ^2.4|^3.0
- kachnitel/admin-bundle: dev-master
- matthiasnoback/symfony-dependency-injection-test: ^6.0
- nyholm/symfony-bundle-test: ^2.0|^3.0
- phpunit/phpunit: ^11.0
- symfony/browser-kit: ^5.4|^6.4|^7.0
- symfony/css-selector: ^5.4|^6.4|^7.0
- symfony/framework-bundle: ^5.4|^6.4|^7.0
- symfony/ux-twig-component: ^2.13|^2.22
- symfony/var-dumper: ^5.4|^6.4|^7.0
Suggests
- kachnitel/admin-bundle: For audit log viewing with filtering and pagination
- symfony/ux-twig-component: For using Audit Twig components
This package is auto-updated.
Last update: 2026-01-23 17:20:10 UTC
README
Fork of DamienHarper/auditor-bundle with additional features for audit context, request tracking, snapshots, and admin integration.
Documentation
- Context & Metadata - Add notes, reasons, and request IDs to audits
- Querying Audits - Query audit entries with filters and timeline views
- Snapshots - Reconstruct entity state at any point in history
- Domain Events - Create EVENT-type audits for business actions
- Admin Integration - Browse audit logs in kachnitel/admin-bundle
- Configuration - Full configuration reference
For core auditing functionality, see the original documentation.
Features
| Feature | Description |
|---|---|
| AuditContext | Add metadata (notes, reasons) to audit entries |
| Request ID Tracking | Correlate audits from the same HTTP request |
| User Timeline | View related user activity around an audit entry |
| AuditReader | Query audit entries with comprehensive filters |
| Snapshot | Reconstruct entity state at any point in history |
| EventAuditService | Create EVENT-type audits for domain events |
| Admin Integration | Browse audit logs in kachnitel/admin-bundle |
Installation
composer require kachnitel/auditor-bundle
Quick Start
# config/packages/kachnitel_auditor.yaml kachnitel_auditor: providers: doctrine: entities: App\Entity\Product: ~ App\Entity\Order: ~
Once configured, any database change affecting audited entities is automatically logged to *_audit tables.
// Add context to audit entries public function adjustStock(AuditContext $auditContext, Product $product): void { $auditContext->set(['note' => 'Manual correction', 'reason' => 'inventory_count']); $product->setStock(95); $this->em->flush(); } // Query audit history $entries = $reader->findByEntityClass(Product::class, [$productId]); // Get historical state $historicalData = $snapshot->getPropertiesSnapshot($products, $date, ['stock', 'price']);
Requirements
- PHP >= 8.2
- Symfony >= 5.4
- Doctrine ORM >= 3.1
Migration
Migrating from damienharper/auditor-bundle? See MIGRATION.md.
License
MIT - see LICENSE