This branch is for CakePHP 5.3+. See version map for details.
Audit-trail plugin: records every create / update / delete on your Table classes, together with who made the change and from which request.
- Entity audit trail β single behavior captures changed fields, before/after values, user, and request context.
- Tamper-evidence β optional SHA-256 hash chain for GoBD / SOX / HIPAA-grade integrity, verifiable via CLI.
- Admin viewer β built-in dashboard, coverage report, search, diffs, timeline, and CSV/JSON export under
/admin/audit-stash. - Monitoring & alerting β rules for mass-deletion and off-hours activity, notifications via email, webhook, or log channel.
- Retention & cleanup β per-table retention policies and a dry-run-friendly cleanup CLI.
- GDPR helpers β redaction and subject-access-export tooling.
- Custom event types β log arbitrary actions (logins, exports, permission grants) through the same persister and viewer.
- Flexible storage β database persister out of the box, optional Elasticsearch driver, or plug in your own.
composer require dereuromark/cakephp-audit-stash
bin/cake plugin load AuditStash
bin/cake migrations migrate -p AuditStashThen enable the behavior on any Table you want tracked β see the Getting Started guide for the full walkthrough.
Full docs: https://dereuromark.github.io/cakephp-audit-stash/
- Getting Started β installation, behavior setup, request metadata
- Configuration β persisters, table list, route prefix
- Usage β behavior options, custom events, custom persisters
- Testing β
AuditAssertionsTraitfor your own test suite - Features overview β viewer, monitoring, retention, tamper-evidence, GDPR
https://sandbox.dereuromark.de/sandbox/audit-stash
If you need to moderate or approve changes before they happen (rather than auditing them after), check out the Bouncer plugin. AuditStash records what already changed; Bouncer gates changes before they're persisted.