PHPackages                             faustvik/yii2-audit-log - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. faustvik/yii2-audit-log

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

faustvik/yii2-audit-log
=======================

Audit log package for Yii2 with framework-agnostic core

v1.0.2(2mo ago)02MITPHPPHP &gt;=8.2

Since Apr 7Pushed 2mo agoCompare

[ Source](https://github.com/FaustVik/yii2-audit-log)[ Packagist](https://packagist.org/packages/faustvik/yii2-audit-log)[ RSS](/packages/faustvik-yii2-audit-log/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

Yii2 Audit Log Package
======================

[](#yii2-audit-log-package)

Audit logging package for Yii2 applications with framework-agnostic core.

Features
--------

[](#features)

- **Automatic logging** - INSERT, UPDATE, DELETE operations via Behavior
- **Events** - Before/After log events for customization
- **Query builder** - Advanced filtering with AuditLogQuery
- **Ready-to-use widgets** - Display change history with filters
- **Framework-agnostic core** - Can be used with any PHP framework
- **Yii2 integration** - Behavior, Widgets, Migrations out of the box

Requirements
------------

[](#requirements)

- PHP 8.2+
- Yii2 2.0.51+

Quick Start
-----------

[](#quick-start)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require faustvik/yii2-audit-log
```

### 2. Add Behavior to Model

[](#2-add-behavior-to-model)

```
use FaustVik\AuditLog\Yii2\Integration\AuditLogBehavior;

class User extends ActiveRecord
{
    public function behaviors(): array
    {
        return [
            'auditLog' => [
                'class' => AuditLogBehavior::class,
                'excludeAttributes' => ['hash_password', 'auth_key'],
            ],
        ];
    }
}
```

### 3. Display in View

[](#3-display-in-view)

```
