Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weesee/yii2-audittrail-demo
A minimal demo for the Sammaye/yii2-audittrail extension
https://github.com/weesee/yii2-audittrail-demo
audittrail demo yii2
Last synced: about 2 months ago
JSON representation
A minimal demo for the Sammaye/yii2-audittrail extension
- Host: GitHub
- URL: https://github.com/weesee/yii2-audittrail-demo
- Owner: WeeSee
- License: other
- Created: 2017-08-24T23:39:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-25T00:06:09.000Z (over 7 years ago)
- Last Synced: 2024-10-27T17:06:44.521Z (3 months ago)
- Topics: audittrail, demo, yii2
- Language: PHP
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Demo for Sammaye/yii2-audittrail
## Installation
### Step 1: Config Database
```cp config/db-dist.php config/db.php``` and vi config/db.php
*
### Step 2: Initialize DatabaseFirst make a MySQL database ```yii2test`´`.
Then create the table for the model ```app\models\Person```.
CREATE TABLE IF NOT EXISTS `audit_trail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`old_value` text,
`new_value` text,
`action` varchar(255) NOT NULL,
`model` varchar(255) NOT NULL,
`field` varchar(255) DEFAULT NULL,
`stamp` datetime NOT NULL,
`user_id` varchar(255) DEFAULT NULL,
`model_id` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_audit_trail_user_id` (`user_id`),
KEY `idx_audit_trail_model_id` (`model_id`),
KEY `idx_audit_trail_model` (`model`),
KEY `idx_audit_trail_field` (`field`),
KEY `idx_audit_trail_action` (`action`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;Please note that the idx_* fiels are created when installing the yii2-audittrail extension.
### Step 3: Start application
http://.../yii2test/index.php
Login with demo/demo
Navigate to "Personen".
Create some persons. Make some changes.
Now you can view the audit trail by clicking on the briefcase button in the row where you made the changes.
## References
Thanks for the superb work:
* https://github.com/Sammaye/yii2-audittrail
* Yii2