PHPackages                             bluora/laravel-model-change-tracking - 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. [Database &amp; ORM](/categories/database)
4. /
5. bluora/laravel-model-change-tracking

Abandoned → [hnhdigital-os/laravel-model-change-tracking](/?search=hnhdigital-os%2Flaravel-model-change-tracking)Library[Database &amp; ORM](/categories/database)

bluora/laravel-model-change-tracking
====================================

Provides support for tracking current user against model changes for the Eloquent ORM

1.0.3(8y ago)81.4k[1 issues](https://github.com/bluora/laravel-model-change-tracking/issues)MITPHPPHP &gt;=5.4.0

Since Apr 15Pushed 7y ago2 watchersCompare

[ Source](https://github.com/bluora/laravel-model-change-tracking)[ Packagist](https://packagist.org/packages/bluora/laravel-model-change-tracking)[ RSS](/packages/bluora-laravel-model-change-tracking/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (5)Versions (6)Used By (0)

Change tracking for Laravel Eloquent model's
============================================

[](#change-tracking-for-laravel-eloquent-models)

This package provides a number of traits to track changes made to a model.

[![Latest Stable Version](https://camo.githubusercontent.com/3050025817c59bc256201dcc2e83ca58ad26a61d9a853d88e0c8e434f6e89175/68747470733a2f2f706f7365722e707567782e6f72672f686e686469676974616c2d6f732f6c61726176656c2d6d6f64656c2d6368616e67652d747261636b696e672f762f737461626c652e737667)](https://packagist.org/packages/hnhdigital-os/laravel-model-change-tracking) [![Total Downloads](https://camo.githubusercontent.com/a30d45690bf6a1f27cf08da354a68e5d2aee27d368f5e687fc52805bd2fa4a1f/68747470733a2f2f706f7365722e707567782e6f72672f686e686469676974616c2d6f732f6c61726176656c2d6d6f64656c2d6368616e67652d747261636b696e672f646f776e6c6f6164732e737667)](https://packagist.org/packages/hnhdigital-os/laravel-model-change-tracking) [![Latest Unstable Version](https://camo.githubusercontent.com/3943057db7e57d707726391d6f7043b7ed1ed25662382363fbfb3e4fc5e98a40/68747470733a2f2f706f7365722e707567782e6f72672f686e686469676974616c2d6f732f6c61726176656c2d6d6f64656c2d6368616e67652d747261636b696e672f762f756e737461626c652e737667)](https://packagist.org/packages/hnhdigital-os/laravel-model-change-tracking) [![License](https://camo.githubusercontent.com/f725988171d3b69e18eece1b6bcc1387d9b91395aa1f3fd3611736717e65e280/68747470733a2f2f706f7365722e707567782e6f72672f686e686469676974616c2d6f732f6c61726176656c2d6d6f64656c2d6368616e67652d747261636b696e672f6c6963656e73652e737667)](https://packagist.org/packages/hnhdigital-os/laravel-model-change-tracking)

[![Build Status](https://camo.githubusercontent.com/5cd5035a0338644fbe110442ab175f9e7f6ccd337028a53d88748e2fd49f714f/68747470733a2f2f7472617669732d63692e6f72672f686e686469676974616c2d6f732f6c61726176656c2d6d6f64656c2d6368616e67652d747261636b696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hnhdigital-os/laravel-model-change-tracking) [![StyleCI](https://camo.githubusercontent.com/61f382e56d1ca26cf9cbd46ac8520a22af85793ef388dc55c65b3a6ea9ee343f/68747470733a2f2f7374796c6563692e696f2f7265706f732f35333235323133332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/53252133) [![Test Coverage](https://camo.githubusercontent.com/dfdc2fd9ce190d01241c80742fefcd279836162c27730f1e0085b9de1a247892/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f686e686469676974616c2d6f732f6c61726176656c2d6d6f64656c2d6368616e67652d747261636b696e672f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/hnhdigital-os/laravel-model-change-tracking/coverage) [![Issue Count](https://camo.githubusercontent.com/12930bb6d0207bb554c948720df1c2ef9fe3e36b9d8e8526eede3f0156230bf2/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f686e686469676974616c2d6f732f6c61726176656c2d6d6f64656c2d6368616e67652d747261636b696e672f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/hnhdigital-os/laravel-model-change-tracking) [![Code Climate](https://camo.githubusercontent.com/de3de6839da570fd6f9c638fedb4206f3b1c1a8462c5046dfc7c6c257d3ab99b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f686e686469676974616c2d6f732f6c61726176656c2d6d6f64656c2d6368616e67652d747261636b696e672f6261646765732f6770612e737667)](https://codeclimate.com/github/hnhdigital-os/laravel-model-change-tracking)

Install
-------

[](#install)

Via composer:

`$ composer require hnhdigital-os/laravel-model-change-tracking ~1.0`

This package's service provider will autoload from Laravel 5.5.

To enable the service provider in versions prior to Laravel 5.4, edit the config/app.php:

```
    'providers' => [
        ...
        Bluora\LaravelModelChangeTracking\ServiceProvider::class,
        ...
    ];
```

State Change
------------

[](#state-change)

Track state changes on your model and by which user for the following states - `created`, `updated`, `deleted`, and `restored`.

Attribute Change Trait
----------------------

[](#attribute-change-trait)

Adds a `saving` event to the model to track changes to all attribute values.

Change by User Trait
--------------------

[](#change-by-user-trait)

Adds events to set a attribute to the current user for when a model is `created`, `updated`, `archived`, or `deleted`.

Usage
-----

[](#usage)

### User tracking of changes.

[](#user-tracking-of-changes)

Add a `created_by`, `updated_by`, `archived_by`, and `deleted_by` attributes to your model's database table.

```
namespace App\Models;

use Bluora\LaravelModelChangeTracking\ChangeByUserTrait;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use ChangeByUserTrait;
}
```

#### Turn off tracking attribute

[](#turn-off-tracking-attribute)

You can turn off by returning false.

```
public function getCreatedByColumn()
{
    return false;
}

public function getUpdatedByColumn()
{
    return false;
}

public function getArchivedByColumn()
{
    return false;
}

public function getDeletedByColumn()
{
    return false;
}
```

#### Different attribute name

[](#different-attribute-name)

You can specify the attribute name in the return value.

```
public function getCreatedByColumn()
{
    return 'created_by';
}

public function getUpdatedByColumn()
{
    return 'updated_by';
}

public function getArchivedByColumn()
{
    return 'updated_by';
}

public function getDeletedByColumn()
{
    return 'deleted_by';
}
```

### Track state changes of models

[](#track-state-changes-of-models)

Tracks model state changes externally in database table.

```
namespace App\Models;

use Bluora\LaravelModelChangeTracking\LogStateChangeTrait;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use LogStateChangeTrait;
}
```

### Log each attribute value change

[](#log-each-attribute-value-change)

Tracks attribute value changes.

```
namespace App\Models;

use Bluora\LaravelModelChangeTracking\LogChangeTrait;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use LogChangeTrait;

    protected $do_not_log = [
        'password',
        'remember_token',
    ];
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~51 days

Total

4

Last Release

2985d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5270e3a3d1add4e39f12dfde3ce549999a26f759d7128056083ab07f475259f2?d=identicon)[bluora](/maintainers/bluora)

---

Top Contributors

[![RoccoHoward](https://avatars.githubusercontent.com/u/227896?v=4)](https://github.com/RoccoHoward "RoccoHoward (68 commits)")

---

Tags

laraveleloquentilluminate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bluora-laravel-model-change-tracking/health.svg)

```
[![Health](https://phpackages.com/badges/bluora-laravel-model-change-tracking/health.svg)](https://phpackages.com/packages/bluora-laravel-model-change-tracking)
```

###  Alternatives

[darrylkuhn/dialect

Provides JSON datatype support for the Eloquent ORM

130245.3k](/packages/darrylkuhn-dialect)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[mpyw/laravel-local-class-scope

A tiny macro that reuse a global scope class as a local scope

24102.6k](/packages/mpyw-laravel-local-class-scope)[hnhdigital-os/laravel-model-json

Provides JSON column support for for Laravel's Eloquent Model.

351.8k](/packages/hnhdigital-os-laravel-model-json)

PHPackages © 2026

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