PHPackages                             rcsofttech/audit-trail-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. rcsofttech/audit-trail-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

rcsofttech/audit-trail-bundle
=============================

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

v4.3.3(2mo ago)12017.1k↑163.1%7[2 issues](https://github.com/rcsofttech85/AuditTrailBundle/issues)MITPHPPHP ^8.4CI passing

Since Dec 22Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/rcsofttech85/AuditTrailBundle)[ Packagist](https://packagist.org/packages/rcsofttech/audit-trail-bundle)[ GitHub Sponsors](https://github.com/rcsofttech85)[ RSS](/packages/rcsofttech-audit-trail-bundle/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (246)Versions (65)Used By (0)

AuditTrailBundle
================

[](#audittrailbundle)

[![CI](https://github.com/rcsofttech85/AuditTrailBundle/actions/workflows/ci.yaml/badge.svg)](https://github.com/rcsofttech85/AuditTrailBundle/actions/workflows/ci.yaml)[![Version](https://camo.githubusercontent.com/8406518ccb0e9f155adda9a3ab1225f819b7acf9589e88020455480125e43e23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7263736f6674746563682f61756469742d747261696c2d62756e646c652e7376673f6c6162656c3d737461626c65)](https://packagist.org/packages/rcsofttech/audit-trail-bundle)[![Downloads](https://camo.githubusercontent.com/766c293fcb49a6ab79d8a50e0d3e2089e159314043969083c07948035c0f3fc5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7263736f6674746563682f61756469742d747261696c2d62756e646c652e737667)](https://packagist.org/packages/rcsofttech/audit-trail-bundle)[![License](https://camo.githubusercontent.com/ebd1da1fbf3302a6433f89f8e858c0a3808358d7fc49547de15a81ed3d8c3ae9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7263736f66747465636838352f4175646974547261696c42756e646c65)](https://packagist.org/packages/rcsofttech/audit-trail-bundle)[![Codacy Badge](https://camo.githubusercontent.com/62e32a767d90cd705ec9abf44c57fa7bb548e893a4eb8fec938fe4aa624c7507/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3437333765393263363463633465363362373831303136656665623438613939)](https://app.codacy.com/gh/rcsofttech85/AuditTrailBundle/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Codacy Badge](https://camo.githubusercontent.com/7c4ae84bd35affd8a6986bf78203cdc1c2e98eaeefb03fdd33088f901d357922/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3437333765393263363463633465363362373831303136656665623438613939)](https://app.codacy.com/gh/rcsofttech85/AuditTrailBundle/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)[![Mutation Testing](https://camo.githubusercontent.com/a4ba80ee13538b0717f3784ea63ab5b37e4617444d0dba00a913b14b30ac2ab9/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532467263736f66747465636838352532464175646974547261696c42756e646c652532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/rcsofttech85/AuditTrailBundle/main)

AuditTrailBundle records Doctrine ORM entity changes in Symfony applications. It captures changes during Doctrine flush, stores audit logs, supports multiple delivery transports, and provides tools for integrity verification, review, export, and recovery.

Documentation
-------------

[](#documentation)

Full documentation now lives on GitHub Pages:

- **Current docs:** [AuditTrailBundle 4.x documentation](https://rcsofttech85.github.io/audit-trail-bundle/docs/4.x/)
- **Configuration:** [configuration reference](https://rcsofttech85.github.io/audit-trail-bundle/docs/4.x/configuration/)
- **Transports:** [database, async database, queue, HTTP, and chain](https://rcsofttech85.github.io/audit-trail-bundle/docs/4.x/transports/)
- **Usage &amp; AuditReader:** [attributes, context, events, and query API](https://rcsofttech85.github.io/audit-trail-bundle/docs/4.x/usage/)
- **Operations:** [revert, CLI, exports, and serialization](https://rcsofttech85.github.io/audit-trail-bundle/docs/4.x/operations/)
- **Upgrade &amp; Architecture:** [upgrade guides and architecture notes](https://rcsofttech85.github.io/audit-trail-bundle/docs/4.x/upgrade-architecture/)

For older versions, use the README and docs from the matching GitHub tag unless archived public docs are added later.

Features
--------

[](#features)

- Doctrine entity audit logs for create, update, delete, soft-delete, restore, access, and revert flows
- Split-phase architecture that avoids nested Doctrine `flush()` calls
- Database, async database, queue, HTTP, and chain-style delivery options
- PHP attributes for `#[Auditable]`, `#[AuditCondition]`, `#[AuditAccess]`, and `#[Sensitive]`
- Sensitive data masking with `#[SensitiveParameter]` and bundle-level sensitive fields
- AuditReader API for history, filtering, diffs, changed fields, pagination, and existence checks
- EasyAdmin integration, Symfony profiler support, CLI commands, exports, and revert tooling
- HMAC signing for stored audit logs and transport payloads
- Extension points for voters, context contributors, transports, AI metadata, and revert handlers

Quick Start
-----------

[](#quick-start)

### Install

[](#install)

```
composer require rcsofttech/audit-trail-bundle
```

Optional packages depend on the features you enable:

```
composer require symfony/messenger          # async database or queue transport
composer require symfony/http-client       # HTTP transport
composer require easycorp/easyadmin-bundle # EasyAdmin dashboard
```

### Prepare The Database

[](#prepare-the-database)

The database transport is enabled by default. Generate and run a Doctrine migration for the audit log table:

```
php bin/console make:migration
php bin/console doctrine:migrations:migrate
```

### Mark An Entity As Auditable

[](#mark-an-entity-as-auditable)

The example uses PHP 8.4 asymmetric property visibility (`public private(set)`) and constructor property promotion for normal entity fields. Keep the generated ID outside the constructor so callers cannot pass it accidentally.

```
