PHPackages                             somnambulist/laravel-doctrine-entity-audit - 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. somnambulist/laravel-doctrine-entity-audit

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

somnambulist/laravel-doctrine-entity-audit
==========================================

A port of the SimpleThings EntityAudit package re-worked for Laravel 5+

0.7.3(5y ago)46.0k2LGPL-2.1PHPPHP &gt;=7CI failing

Since Jul 6Pushed 3y ago2 watchersCompare

[ Source](https://github.com/somnambulist-tech/laravel-doctrine-entity-audit)[ Packagist](https://packagist.org/packages/somnambulist/laravel-doctrine-entity-audit)[ RSS](/packages/somnambulist-laravel-doctrine-entity-audit/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (14)Used By (2)

Entity Auditing for Doctrine in Laravel
=======================================

[](#entity-auditing-for-doctrine-in-laravel)

[![GitHub Actions Build Status](https://camo.githubusercontent.com/b3b3d5866d7854c18da30cdee14266b587a37c777329d28e39aba959bf00197d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736f6d6e616d62756c6973742d746563682f6c61726176656c2d646f637472696e652d656e746974792d61756469742f74657374732e796d6c3f6c6f676f3d676974687562266272616e63683d6d6173746572)](https://github.com/somnambulist-tech/laravel-doctrine-entity-audit/actions?query=workflow%3Atests)[![Issues](https://camo.githubusercontent.com/c3508d17fab861e2a5feaf1f2b5aa5f972ff91703f992ec4b8d06883c616aa7b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f736f6d6e616d62756c6973742d746563682f6c61726176656c2d646f637472696e652d656e746974792d61756469743f6c6f676f3d676974687562)](https://github.com/somnambulist-tech/laravel-doctrine-entity-audit/issues)[![License](https://camo.githubusercontent.com/39e43f2334c11ce092e23ad5c06354e4ef069bf6b1c95fc897da20162219245e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736f6d6e616d62756c6973742d746563682f6c61726176656c2d646f637472696e652d656e746974792d61756469743f6c6f676f3d676974687562)](https://github.com/somnambulist-tech/laravel-doctrine-entity-audit/blob/master/LICENSE)[![PHP Version](https://camo.githubusercontent.com/5df335e5ba6d434194c5fc176bff1b37058f75fccf1abe2bf934d60c2e34c0bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736f6d6e616d62756c6973742f6c61726176656c2d646f637472696e652d656e746974792d61756469743f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/somnambulist/laravel-doctrine-entity-audit)[![Current Version](https://camo.githubusercontent.com/d4377de23f36f62b92fc367e7aca5dffd2c5276cdc20377f8559593aeb7bbef9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f6d6e616d62756c6973742f6c61726176656c2d646f637472696e652d656e746974792d61756469743f6c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/somnambulist/laravel-doctrine-entity-audit)

This is a fork of the SimpleThings EntityAudit project, re-worked for usage with Laravel and the Laravel-Doctrine package. It maintains the same style of working, generating a revision for all tagged entities.

Need a Symfony based version? Check out the original [SimpleThings EntityAudit](https://github.com/simplethings/EntityAudit).

To protect from conflicts it has been re-namespaced and some internals changed.

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

[](#installation)

- composer require somnambulist/laravel-doctrine-entity-audit
- add the ServiceProvider to your config/app.php after the Doctrine provider
- ./artisan vendor:publish
- update the config file and then generate the audit tables:
    - ./artisan doctrine:migrations:diff
    - ./artisan doctrine:migrations:migrate

### Configuring UserResolver

[](#configuring-userresolver)

The UserResolver implementation may be switched out for another implementation by implementing the `UserResolverInterface` and binding this to the container in your `AppServiceProvider`. This needs to be during registration and not boot.

Alternatively: the `UserResolver` may be switched out at run time by accessing the `AuditConfiguration`from the `AuditRegistry` for the entity manager and setting a new resolver instance:

```
use Somnambulist\EntityAudit\AuditRegistry;

$app->get(AuditRegistry::class)->get(/* $emName */)->getConfiguration()->setUserResolver($resolver);
```

If the entity manager name is not specified, the default will be chosen. Note that the configuration is shared with the `AuditReader`. It is recommended to set the UserResolver this way as early as possible and preferably before loading and modifying any entities to avoid issues with user resolution.

Unit Tests
----------

[](#unit-tests)

The existing unit tests have been ported over excluding the Gedmo soft-deleteable. To run the unit tests, ensure the dev dependencies have been installed:

- vendor/bin/phpunit

Todo
----

[](#todo)

- refactor and simplify the listener internals
- remove any remaining deprecated Doctrine API calls

From SimpleThings:

- currently only works with auto-increment databases
- proper metadata mapping is necessary, allow to disable versioning for fields and associations.
- support Joined-Table-Inheritance
- support many-to-many auditing

Links
-----

[](#links)

- [Laravel Doctrine](http://laraveldoctrine.org)
- [Laravel](http://laravel.com)
- [Doctrine](http://doctrine-project.org)
- [SimpleThings EntityAudit](https://github.com/simplethings/EntityAudit)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

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 ~150 days

Recently: every ~344 days

Total

13

Last Release

1850d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.5.9

0.6.0PHP &gt;=7

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0e439bf91b68c2e81e0250c752d3a552e78752c91acdf00c72a1f93aeb1ceca?d=identicon)[dredfern](/maintainers/dredfern)

---

Top Contributors

[![dave-redfern](https://avatars.githubusercontent.com/u/1477147?v=4)](https://github.com/dave-redfern "dave-redfern (11 commits)")

---

Tags

auditingentity-auditinglaravellaravel-doctrinesimplethingssimplethings-entityauditlaraveldoctrineentityAuditauditinglaravel-doctrine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/somnambulist-laravel-doctrine-entity-audit/health.svg)

```
[![Health](https://phpackages.com/badges/somnambulist-laravel-doctrine-entity-audit/health.svg)](https://phpackages.com/packages/somnambulist-laravel-doctrine-entity-audit)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k36.8M157](/packages/owen-it-laravel-auditing)[laravel-doctrine/extensions

Doctrine extensions for Laravel

493.6M19](/packages/laravel-doctrine-extensions)[altek/accountant

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

921.0M4](/packages/altek-accountant)[laravel-doctrine/acl

ACL for Laravel and Doctrine

44476.5k7](/packages/laravel-doctrine-acl)[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)[somnambulist/laravel-doctrine-tenancy

A multi-tenancy implementation that uses Laravel and Doctrine.

162.8k](/packages/somnambulist-laravel-doctrine-tenancy)

PHPackages © 2026

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