jansuchanek/naudit
最新稳定版本:v1.1.0
Composer 安装命令:
composer require jansuchanek/naudit
包简介
Doctrine entity audit log for Nette — automatic change tracking with user context
README 文档
README
Doctrine entity audit log for Nette Framework — automatically tracks changes to entities.
Features
- 📝 Change Tracking — Records create/update/delete with field diffs
- 🔌 AuditableInterface — Mark entities for tracking
- 📊 JSON Storage — Changes stored as JSON in
audit_logtable - ⚙️ DI Extension — Auto-registers Doctrine event subscriber
Installation
composer require jansuchanek/naudit
Configuration
extensions: audit: NAudit\DI\NAuditExtension
Usage
Implement AuditableInterface on your entities:
use NAudit\AuditableInterface; class Product implements AuditableInterface { use AuditableTrait; public function getAuditLabel(): string { return $this->name; } }
Migration
CREATE TABLE audit_log ( id INT AUTO_INCREMENT PRIMARY KEY, entity_class VARCHAR(255) NOT NULL, entity_id INT NOT NULL, action VARCHAR(16) NOT NULL, changes JSON, user_id INT, created_at DATETIME NOT NULL, INDEX idx_entity (entity_class, entity_id) );
Requirements
- PHP >= 8.2
- Doctrine ORM ^3.0
- Nette DI ^3.2
License
MIT
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-20