/LogAction-Plugin

CakePHP plugin to monitor changes to the database made by a user.

Primary LanguagePHP

LogAction CakePHP Plugin

Version 8, by J. Miller

This will monitor specified fields in your database for changes. It will log the before and after values of changes, as well as the user_id that made the change.

Installation

  1. Run the following command to create the database table log_actions.

    cake schema create --plugin LogAction

  2. Load the plugin in Config/bootstrap.php

    CakePlugin::load('LogAction');

  3. Add the behavior to the model(s) you want to monitor, and specify the fields to monitor. If you don't specify fields, then it will monitor all fields.

    public $actsAs = array( 'LogAction.LogAction' => array( 'fields' => array('title', 'body'), 'trackDelete' => false ) );

TODO

  • Add support for AppModel, to monitor all fields in all tables, or specified fields on all tables