PHPackages                             luissantiago/elogquent - 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. luissantiago/elogquent

ActiveLibrary[Database &amp; ORM](/categories/database)

luissantiago/elogquent
======================

Listens to Eloquent model events and logs configured attribute changes into a history table.

v1.0.5(1y ago)1916[2 PRs](https://github.com/LuisSantiago/elogquent/pulls)MITPHPPHP ^8.2 || ^8.3 || ^8.4CI passing

Since May 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/LuisSantiago/elogquent)[ Packagist](https://packagist.org/packages/luissantiago/elogquent)[ Docs](https://github.com/luissantiago/elogquent)[ GitHub Sponsors](https://github.com/luissantiago)[ RSS](/packages/luissantiago-elogquent/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (6)Used By (0)

 [![Elogquent Logo](assets/logo.png)](assets/logo.png)

 [![PHP Version](https://camo.githubusercontent.com/ff14390cfb513daeb96c88b2b926832f4a9730443a26e8ad355c0e9a5b837d0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c75697373616e746961676f2f656c6f677175656e74)](https://packagist.org/packages/luissantiago/elogquent) [![Latest Version](https://camo.githubusercontent.com/4141145f5cfed4a62c4381e9fc852809786a32ad3d986c5b5528c4503a62d11d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c75697373616e746961676f2f656c6f677175656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/luissantiago/elogquent) [![Total Downloads](https://camo.githubusercontent.com/01e65319964be0eb5bca5559db516e7bb396dd4e2f1144badaf248eee588e071/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c75697373616e746961676f2f656c6f677175656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/luissantiago/elogquent) [![Tests](https://github.com/luissantiago/elogquent/actions/workflows/run-tests.yml/badge.svg)](https://github.com/luissantiago/elogquent/actions/workflows/run-tests.yml) [![Lint](https://github.com/luissantiago/elogquent/actions/workflows/code-quality.yml/badge.svg)](https://github.com/luissantiago/elogquent/actions/workflows/code-quality.yml) [![Coverage](https://camo.githubusercontent.com/f226afd4e6881d4b61c8504616efb596d2bed500ffc2a1af0926f1b6417991de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d39312532352d627269676874677265656e)](https://github.com/luissantiago/elogquent)

---

**Elogquent** is a Laravel package that automatically tracks and stores all changes made to your Eloquent models.
It provides a complete audit trail and allows restoring models to previous states with ease.

### Restore Preview

[](#restore-preview)

 [![RestoreChanges Animation](assets/RestoreChanges.gif)](assets/RestoreChanges.gif)

---

Features
--------

[](#features)

- Automatic model change tracking
- Configurable attribute inclusion/exclusion
- Detailed change history per model
- Restore previous model states
- Duplicate change optimization
- User attribution for changes
- Supports queue-based processing

---

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require luissantiago/elogquent
```

Publish config and install:

```
php artisan elogquent:install
```

Run the database migrations:

```
php artisan migrate
```

---

Usage
-----

[](#usage)

### Add Trait to Your Model

[](#add-trait-to-your-model)

```
use Elogquent\Traits\Elogquent;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    use Elogquent;
}
```

### Access Change History

[](#access-change-history)

```
$post = Post::find(1);
$changes = $post->allChanges;
```

### Restore to a Previous State

[](#restore-to-a-previous-state)

```
$modelChange = ElogquentEntry::find(1);
$modelChange->restore();
```

Or use the artisan command:

```
php artisan elogquent:restore-changes
```

---

Configuration
-------------

[](#configuration)

Edit the `elogquent.php` config file for customization.

### Basic Settings

[](#basic-settings)

OptionDescriptionDefault`enabled`Enable or disable Elogquent globally.`true``store_user_id`Store the authenticated user's ID with each change.`true``database_connection`The database connection used for change history.Laravel default### Column Filtering

[](#column-filtering)

OptionDescription`included_columns`Specific columns to track. If empty, all columns are tracked (except excluded).`excluded_columns`Columns to ignore (e.g. sensitive fields). Default: `password`, `remember_token`, `api_token`, `secret`, `token`, `updated_at`### History Optimization

[](#history-optimization)

OptionDescription`remove_previous_duplicates`Prevent logging identical consecutive states. Keeps only the latest.### Change Limits

[](#change-limits)

OptionDescription`changes_limit`Global limit on total number of stored changes.`model_changes_limit`Limit changes per model. Example: `'App\Models\Post::class' => 100`### Queue Settings

[](#queue-settings)

OptionDescriptionDefault`queue.delay`Delay (in seconds) before processing updates.`0``queue.connection`Queue connection to use.Laravel default (`queue.default`)`queue.queue`Queue name for change jobs.`null`---

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

---

License
-------

[](#license)

The MIT License (MIT). See [License File](LICENSE.md) for more information.

---

Credits
-------

[](#credits)

- [Luis Santiago](https://github.com/luissantiago)

---

Support
-------

[](#support)

For support, open an issue in the GitHub repository or contact
****

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance73

Regular maintenance activity

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

366d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ed30c0c9122c5d11b548158e96f911aafaa6b96268d8231c28212364d78e1bc?d=identicon)[LuisSantiago](/maintainers/LuisSantiago)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![LuisSantiago](https://avatars.githubusercontent.com/u/5711306?v=4)](https://github.com/LuisSantiago "LuisSantiago (2 commits)")[![lstordev](https://avatars.githubusercontent.com/u/210289138?v=4)](https://github.com/lstordev "lstordev (1 commits)")

---

Tags

loglaraveleloquentAuditauditinghistorymodel eventselogquent

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/luissantiago-elogquent/health.svg)

```
[![Health](https://phpackages.com/badges/luissantiago-elogquent/health.svg)](https://phpackages.com/packages/luissantiago-elogquent)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[altek/accountant

The auditing &amp; accountability package for Laravel's Eloquent ORM.

92954.3k4](/packages/altek-accountant)[betapeak/laravel-auditing-filesystem

A filesystem driver for the owen-it/laravel-auditing package. Allows storage of the audits in CSV files, across all registered Laravel disks.

166.5k](/packages/betapeak-laravel-auditing-filesystem)

PHPackages © 2026

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