PHPackages                             luketowers/wn-easyaudit-plugin - 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. luketowers/wn-easyaudit-plugin

ActiveWinter-plugin[Logging &amp; Monitoring](/categories/logging)

luketowers/wn-easyaudit-plugin
==============================

View and manage audit logs for models within your Winter CMS projects

173.1k↓32%10[2 issues](https://github.com/LukeTowers/wn-easyaudit-plugin/issues)PHP

Since May 2Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/LukeTowers/wn-easyaudit-plugin)[ Packagist](https://packagist.org/packages/luketowers/wn-easyaudit-plugin)[ RSS](/packages/luketowers-wn-easyaudit-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

About
=====

[](#about)

Easily view and manage audit logs for models within your Winter CMS projects.

Installation
============

[](#installation)

This plugin requires a [paid license ($30 USD)](https://paypal.me/theluketowers/30USD).

To install it with Composer, run `composer require luketowers/wn-easyaudit-plugin` from your project root.

Documentation
=============

[](#documentation)

To get started using this plugin just add the `TrackableModel` Behavior to any models that you wish to track:

```
class MyModel extends Model
{
    /**
     * @var array Behaviors implemented by this model class
     */
    public $implement = ['@LukeTowers.EasyAudit.Behaviors.TrackableModel'];
}
```

Once you've added the `TrackableModel` behavior to a model, any local events fired on the model that have been set up in `$trackableEvents` will be automatically listened to and an audit record will be generated for each event.

By default, the `TrackableModel` behavior will listen to the following events:

- `model.afterCreate`
- `model.afterUpdate`
- `model.afterDelete`

In addition to the properties above, you can also add the following properties to model classes to configure the audit logging behavior:

```
class MyModel extends Model
{
    // ...

    /**
     * @var array The model events that are to be tracked as activities
     */
    public $trackableEvents = [
        'model.afterCreate' => ['name' => 'created', 'description' => 'The record was created'],
        'model.afterUpdate' => ['name' => 'updated', 'description' => 'The record was updated'],
        'model.afterDelete' => ['name' => 'archived', 'description' => 'The record was archived'],
    ];

    /**
     * @var bool Manually control the IP address logging on this model (default from the luketowers.easyaudit.logIpAddress config setting)
     */
    public $trackableLogIpAddress = true;

    /**
     * @var bool Manually control the User agent logging on this model (default from the luketowers.easyaudit.logUserAgent config setting)
     */
    public $trackableLogUserAgent = true;

    /**
     * @var bool Manually control the change tracking on this model (default from the luketowers.easyaudit.trackChanges config setting)
     */
    public $trackableTrackChanges = true;

    /**
     * @var bool Manually control if the activities field gets automatically injected into backend forms
     * for this model (default from the luketowers.easyaudit.autoInjectActvitiesFormWidget config setting)
     */
    public $trackableInjectActvitiesFormWidget = true;
}
```

You can view a model's audit log by adding a field targeting the `activities` relationship (added by the `TrackableModel` behavior) with the type of `activitylog` to the relevant `fields.yaml` files:

```
activities:
    tab: Audit Log
    context: [update, preview]
    type: activitylog
    span: full
```

Advanced Usage
==============

[](#advanced-usage)

It is also possible to log events directly using the `LukeTowers\EasyAudit\Classes\ActivityLogger` class:

To use, create a new instance of this class and then either chain the methods for the data as required or call the `log()` method directly. Example (all in one):

```
$activity = new ActivityLogger();
$activity->log('updated', 'MyModel updated', $myModel, BackendAuth::getUser(), ['maintenanceMode' => true], 'MyVendor.MyPlugin');
```

Or (chained):

```
$activity = new ActivityLogger();
$activity->inLog('MyVendor.MyPlugin')
        ->for($myModel)
        ->by(BackendAuth::getUser())
        ->description('MyModel updated')
        ->properties(['maintenanceMode' => true])
        ->log('updated');
```

Additionally, the ActivityLogger() class is available on models implementing the `LukeTowers.EasyAudit.Behaviors.TrackableModel` behavior through the `activity()` method. This enables you to do the following:

```
class Asset extends Model
{
    // ...

    public function updateInventory()
    {
        // ...
        $this->activity('updated_inventory')->description("The asset's inventory was updated")->log();
    }
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7253840?v=4)[Luke Towers](/maintainers/LukeTowers)[@LukeTowers](https://github.com/LukeTowers)

---

Top Contributors

[![LukeTowers](https://avatars.githubusercontent.com/u/7253840?v=4)](https://github.com/LukeTowers "LukeTowers (67 commits)")[![AIC-BV](https://avatars.githubusercontent.com/u/89913092?v=4)](https://github.com/AIC-BV "AIC-BV (1 commits)")[![fansaien](https://avatars.githubusercontent.com/u/8133504?v=4)](https://github.com/fansaien "fansaien (1 commits)")

---

Tags

activity-logactivity-log-laravelactivity-loggerlaravelphpwintercmswintercms-plugin

### Embed Badge

![Health badge](/badges/luketowers-wn-easyaudit-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/luketowers-wn-easyaudit-plugin/health.svg)](https://phpackages.com/packages/luketowers-wn-easyaudit-plugin)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
