Skip to content

yepes/yii2-model-log-behavior

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log Behavior

Simple extension to log every change made to any model.

Installation

Install via composser

composer require yepes/yii2-model-log-behavior

Apply migrations:

./yii migrate/up --migrationPath=@vendor/yepes/yii2-model-log-behavior/migrations

Configure the behavior

public function behaviors()
{
    return [
        \goltratec\log\LogBehavior::className()
    ];
}

TODO

Right now, logs are just saved in the database, in a table named goltratec_log

Maybe we should:

  • create a simple UI to view the logs.
  • some method to view the log of a particular model.
  • some way to restore a model to a particular log.

About

Simple behaviour to log all changes made to a model

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages