nowo-tech / audit-kit-bundle
Symfony + Doctrine bundle for automatic created/updated timestamps and blame fields on opt-in entities.
Package info
github.com/nowo-tech/AuditKitBundle
Type:symfony-bundle
pkg:composer/nowo-tech/audit-kit-bundle
Fund package maintenance!
Requires
- php: >=8.2 <8.7
- doctrine/doctrine-bundle: ^2.10 || ^3.0
- doctrine/orm: ^2.15 || ^3.0
- nowo-tech/correlation-contract: ^0.1
- nowo-tech/migrations-kit-contracts: ^1.0
- nowo-tech/transaction-contract: ^1.0
- nowo-tech/transaction-doctrine: ^1.9
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- psr/log: ^1 || ^2 || ^3
- symfony/config: ^7.4 || ^8.0
- symfony/console: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/deprecation-contracts: ^2.5 || ^3.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
- symfony/property-access: ^7.4 || ^8.0
- symfony/security-core: ^7.4 || ^8.0
- symfony/uid: ^7.4 || ^8.0
- twig/extra-bundle: ^3.12
- twig/string-extra: ^3.12
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- igor-php/igor-php: ^0.10.0 || ^0.11.0
- monolog/monolog: ^3.0
- nowo-tech/phpstan-frankenphp: ^1.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: ^2.0
- symfony/clock: ^7.4 || ^8.0
- symfony/http-client: ^7.4 || ^8.0
- symfony/lock: ^7.4 || ^8.0
- symfony/mailer: ^7.4 || ^8.0
- symfony/messenger: ^7.4 || ^8.0
- symfony/yaml: ^7.4 || ^8.0
- twig/twig: ^3.12
Suggests
- monolog/monolog: Adds correlation_id / caused_by to every log record (CorrelationLogProcessor)
- nowo-tech/migrations-kit-bundle: Runs nowo:migrations:check-key-collations, which asserts the declared action log id columns against the live schema (REQ-SEC-006)
- nowo-tech/ui-kit-bundle: Styles the action log timeline partial (nowo-ui-* classes).
- symfony/http-client: Sends X-Correlation-Id on outgoing requests (correlation.http_client)
- symfony/lock: Required by the tamper-evident hash chain (nowo_audit_kit.sealing)
- symfony/mailer: Adds the correlation header to outgoing e-mails (correlation.mailer)
- symfony/messenger: Carries the correlation id across message buses (CorrelationMiddleware, CorrelationIdStamp)
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v2.4.1
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- 1.x-dev
- v1.18.1
- v1.18.0
- v1.17.0
- v1.16.1
- v1.16.0
- v1.15.1
- v1.15.0
- v1.14.1
- v1.14.0
- v1.13.0
- v1.12.0
- v1.11.0
- v1.10.0
- v1.9.0
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.19
- v1.1.18
- v1.1.17
- v1.1.16
- v1.1.15
- v1.1.14
- v1.1.13
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-fix/2.4.1-zesv
- dev-fix/2.3.1-runtime-active
- dev-feat/2.3.0-hash-chain
- dev-feat/2.2.0-traceability-a
- dev-ci/release-gates
- dev-docs/speckit-inventory-2026-11-22
- dev-feat/2.1.0-ddd-host
- dev-feat/arch001-major-2.0.0
- dev-chore/1.x-maintenance
- dev-chore/demo-platform-shell
- dev-fix/schema-fk-collation
- dev-test/full-coverage-1.18-notices
- dev-feat/arch001-notice-1.18.0
- dev-chore/transaction-doctrine-1.8
- dev-fix/concurrency-req-runtime-003
- dev-fix/playwright-image-derive
- dev-chore/phase-c-req
- dev-fix/key-columns-mapped-superclass
- dev-feat/declare-exact-key-columns
- dev-fix/sec006-conformance
- dev-chore/demo-uikit
- dev-feat/arch-001-b1
- dev-fix/worker-memo-a1
- dev-feat/arch-bar-w2
- dev-feat/ddd-p2
- dev-feat/ddd-ports
- dev-chore/symfony-security-2026-11-04
- dev-feat/avatar
This package is auto-updated.
Last update: 2026-11-30 19:03:36 UTC
README
⭐ Found this useful? Install from Packagist and give the repo a star on GitHub.
Symfony + Doctrine bundle for automatic auditing fields on any opt-in entity:
| Field | Set on |
|---|---|
createdAt / updatedAt |
prePersist + preUpdate (timestamps only on update) |
createdBy / updatedBy |
When an authenticated user is present (nullable in CLI) |
Complements nowo-tech/user-kit-bundle (account state / presence) and nowo-tech/auth-kit-bundle (auth flows). |
This bundle is FrankenPHP worker mode friendly, including the strict case where the kernel is not reset between requests. See docs/FRANKENPHP-WORKER-AUDIT.md.
Action log timeline — actor and subject avatars from one resolver call |
Audit fields — blame and timestamps filled on persist |
Features
- Optional traits:
TimestampableTrait,BlameableTrait,AuditableTrait - Public opaque UUID:
PublicUuidInterface+PublicUuidTrait, filled onprePersistbyPublicUuidListener(UUID v7) - Append-only
CreatedAtImmutableTrait(non-nullcreatedAt) SqlLikehelper: escapeLIKEinput with anESCAPE '\'clause that behaves the same on MySQL and SQLiteSqlFulltexthelper: DQL text search with MySQL / MariaDBFULLTEXT(MATCH … AGAINSTboolean prefix query, InnoDB token rules) and an escapedLIKEfallback elsewhere, plus result snippetsKeysetDeletehelper: delete matching rows in short primary-key batches (portable DBAL, keyset over the id)- Doctrine entity listener (
prePersist/preUpdate) - Action log (opt-in):
AbstractActionLogmapped superclass,ActionLogRecorder, filterable repository with keyset purge,nowo:audit-kit:action-log:purgeand an optional Twig timeline — maps onto existing tables with no migration - Traceability (since 2.2, opt-in): one correlation id per request, message or command
(nowo-tech/correlation-contract) on every action log row, in log
records, on outgoing HTTP requests and across Messenger; masked, size-bounded before → after
changes;caused_by; a timeline contract other packages contribute to - Named profiles — separate field mapping and flags per user entity (
User,Admin, …) with O(1) class resolution - Configurable property names and
user_class - Per-entity opt-out via
#[Auditable(enabled: false)] - Guest / CLI safe — blame fields stay
nullwithout errors
Quick start
composer require nowo-tech/audit-kit-bundle
# config/packages/nowo_audit_kit.yaml nowo_audit_kit: default_profile: default profiles: default: user_class: App\Entity\User
The legacy flat layout (user_class at root) remains supported. See Configuration.
use Nowo\AuditKitBundle\Model\AuditableTrait; class Article { use AuditableTrait; }
Requirements
- PHP 8.2+
- Symfony 7.4 | 8.x
- Doctrine ORM 2.15+ | 3.x
Demo
make -C demo/symfony8 up # http://localhost:8013 (default PORT)
Each demo persists entities with automatic audit columns (see demo/symfony8/src/Entity/Article.php and LegacyRecord.php for audited vs opt-out). See demo/symfony8/README.md and docs/DEMO-FRANKENPHP.md for FrankenPHP setup (including worker mode for production).
Development
make up make test-coverage make release-check
Documentation
- Installation
- Configuration
- Usage (Standard host, DDD host, action log flush mode)
- Contributing
- Code of Conduct
- Changelog
- Upgrading
- Concurrency (REQ-RUNTIME-003)
- Hash chain (tamper-evident action log)
- Release
- Security
- Engram
- Spec-driven development
- GitHub Spec Kit
Additional documentation
- GitHub Actions CI requirements
- PSR evaluation (REQ-CS-007)
- Demo with FrankenPHP
- Product spec
- Code inventory
- Doctrine helpers spec
- Action log spec
- Keyset delete spec
- Full-text search spec
Tests and coverage
- Tests: PHPUnit (unit + integration)
- PHP: 100%
- TS/JS: N/A
- Python: N/A
Compatibility: PHP 8.2+ · Symfony 7.4 / 8.0 / 8.1 (CI matrix).
License
MIT — see LICENSE.
Package
- Composer:
nowo-tech/audit-kit-bundle - Config root:
nowo_audit_kit


