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

dev-master / 6.x-dev 2026-01-23 17:20 UTC

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

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