Skip to content

Installation ​

From your CakePHP application directory:

bash
composer require dereuromark/cakephp-audit-stash
bin/cake plugin load AuditStash
bin/cake migrations migrate -p AuditStash

The migrations create and update the audit_logs table for the default database persister. Ensure your application has the Migrations plugin installed and loaded before running the migration command.

If your audited records use UUIDs or another primary key type, configure the polymorphic primary key before the first migration. The default audit subject column is an integer.

Loading AuditStash registers its console commands, monitoring listener, and admin routes. To enable logging, follow Getting started.

The admin routes are registered by default, but return HTTP 403 until you configure AuditStash.adminAccess. See Admin viewer for the required access Closure and host authentication setup.

To disable those routes, update the entry generated by plugin load in config/plugins.php:

php
'AuditStash' => ['routes' => false],

If your application loads plugins directly in Application::bootstrap() instead, use $this->addPlugin('AuditStash', ['routes' => false]) there. Keep one registration.

Released under the MIT License.