Skip to content

Cake Model History is a CakePHP 3 plugin designed for tracking and auditing changes made to your database records

Notifications You must be signed in to change notification settings

mazba/cake-model-history

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CakeSimpleModelHistory plugin for CakePHP

Installation

You can install this plugin into your CakePHP application using composer.

Add the following lines to your application's composer.json:

    "require": {
       "mazba/cake-simple-model-history": "dev-master"
    }	

followed by the command: composer update

Or

The recommended way to install composer packages is:

    composer require "mazba/cake-simple-model-history:dev-master"	

Setup

In config/bootstrap.php add:

    Plugin::load('CakeSimpleModelHistory', ['bootstrap' => false, 'routes' => true]);

or using CakePHP's console:

    ./bin/cake plugin load CakeSimpleModelHistory

Configuration

Add the following line to your AppController:

    use CakeSimpleModelHistory\Controller\ActivityLogsTrait;

Add the following inside your AppController Class

    class AppController extends Controller
    {
        use ActivityLogsTrait;
    }

Finally, you'll also need to run migration on the package

    cake migrations migrate -p CakeSimpleModelHistory

Attach the behavior in the models you want with:

    public function initialize(array $config) {
        $this->addBehavior('CakeSimpleModelHistory.ActivityLogs');
    }

To view history : /cake-simple-model-history

About

Cake Model History is a CakePHP 3 plugin designed for tracking and auditing changes made to your database records

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published