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.
-
Run the following command to create the database table log_actions.
cake schema create --plugin LogAction
-
Load the plugin in Config/bootstrap.php
CakePlugin::load('LogAction');
-
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 ) );
- Add support for AppModel, to monitor all fields in all tables, or specified fields on all tables