PHPackages                             laravel-enso/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. laravel-enso/audit

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

laravel-enso/audit
==================

Model auditing endpoints and change-history storage for Laravel Enso

2.0.7(3w ago)0249—6.3%MITPHPPHP ^8.2

Since Mar 25Pushed 3w agoCompare

[ Source](https://github.com/laravel-enso/audit)[ Packagist](https://packagist.org/packages/laravel-enso/audit)[ Docs](https://github.com/laravel-enso/audit)[ RSS](/packages/laravel-enso-audit/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (7)Versions (12)Used By (0)

Audit
=====

[](#audit)

[![License](https://camo.githubusercontent.com/38181ff017520917090f3eba9695a7ad04e85cd5416006c840eed232886f2fa6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d3130623938312e737667)](https://github.com/laravel-enso/audit/blob/main/LICENSE)[![Stable](https://camo.githubusercontent.com/a63abc4f15cb3f789aeccdd1b5f6198cf2583d80e58b7ea03b570a08ad11b7a1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461626c652d322e302e372d3235363365622e737667)](https://packagist.org/packages/laravel-enso/audit)[![Downloads](https://camo.githubusercontent.com/b2064a2ece04f93d58e6ea407a193490c9435f55191de75aca7ab20ea083d388/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6c61726176656c2d656e736f2f61756469742e737667)](https://packagist.org/packages/laravel-enso/audit)[![PHP](https://camo.githubusercontent.com/da7cf113b588d26fe679dfefe4a15009272ed358ad4e786ad3c78b45faa61d69/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d3737376262342e737667)](https://github.com/laravel-enso/audit/blob/main/composer.json)[![Issues](https://camo.githubusercontent.com/20b2e300939fc9e993c2226ec82f0cf50670cd089668be34ba632e409e204ea8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6c61726176656c2d656e736f2f61756469742e737667)](https://github.com/laravel-enso/audit/issues)[![Merge Requests](https://camo.githubusercontent.com/23f770623ba68a943b9b445a0070ff4e1322597283d653492418305c795332ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f6c61726176656c2d656e736f2f61756469742e737667)](https://github.com/laravel-enso/audit/pulls)

Description
-----------

[](#description)

Audit records Eloquent model create, update, and delete events and exposes them through an Enso table endpoint.

The package does not auto-discover auditable models. Each application or package must explicitly list the models it wants audited in its audit service provider. The package registers the audit observer for those models.

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

[](#installation)

Install the package:

```
composer require laravel-enso/audit
```

Run the package migrations:

```
php artisan migrate
```

Features
--------

[](#features)

- Stores `created`, `updated`, and `deleted` events together with before/after payloads.
- Uses explicit model registration through `AuditServiceProvider::$models`.
- Supports restricted payloads through an `auditableAttributes()` method on the audited model.
- Registers the audit observer for configured models and exposes those classes as select options for the frontend model filter.
- Exposes the audit creation timestamp as a sortable date column for table and date interval filtering.
- Stores the actor through `track-who` on the audit record itself.
- Publishes table-init, table-data, export, and model-options endpoints under `api/system/audit`.

Usage
-----

[](#usage)

Register auditable models from the consuming application or package service provider:

```
namespace App\Providers;

use App\Models\Invoice;
use LaravelEnso\Audit\AuditServiceProvider as ServiceProvider;

class AuditServiceProvider extends ServiceProvider
{
    public $models = [
        Invoice::class,
    ];
}
```

By default, all model attributes are recorded.

To limit the recorded payload, define an `auditableAttributes()` method on the model:

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

class Invoice extends Model
{
    public function auditableAttributes(): array
    {
        return ['status', 'total'];
    }
}
```

Upgrade Guide
-------------

[](#upgrade-guide)

### 2.0.7

[](#207)

Audit providers now declare audited models through `public $models = [...]`. The package registers `LaravelEnso\Audit\Observers\Audit` automatically for that list and exposes the same model list to the frontend filter endpoint. Replace older `$auditable` or `$observers` declarations with `$models`.

### 2.0.3

[](#203)

The audit table now includes the `created_at` date column, enabling the frontend date interval filter on audit rows.

### 2.0.2

[](#202)

Audited model classes are now collected from `AuditServiceProvider::$models`, registered with the audit observer, and exposed through `system.audit.models` / `GET api/system/audit/models` for frontend model filters.

### 2.0.0

[](#200)

This is a breaking release.

Auditable model discovery was removed. Models are no longer detected automatically. List each audited model in `AuditServiceProvider::$models`; the package registers `LaravelEnso\Audit\Observers\Audit` for that list. To restrict the recorded payload, define an `auditableAttributes()` method on that model.

API
---

[](#api)

### Main route group

[](#main-route-group)

Mounted under `api/system/audit`:

- `system.audit.initTable`
- `system.audit.tableData`
- `system.audit.exportExcel`
- `system.audit.models`

The model options route returns the audited models registered through `AuditServiceProvider::$models`:

- `GET api/system/audit/models`

### Core classes

[](#core-classes)

- `LaravelEnso\Audit\AuditServiceProvider`
- `LaravelEnso\Audit\Observers\Audit`
- `LaravelEnso\Audit\Models\Audit`
- `LaravelEnso\Audit\Services\Models`

Depends On
----------

[](#depends-on)

Required Enso packages:

- [`laravel-enso/enums`](https://github.com/laravel-enso/enums)
- [`laravel-enso/migrator`](https://github.com/laravel-enso/migrator)
- [`laravel-enso/select`](https://docs.laravel-enso.com/backend/select.html)
- [`laravel-enso/tables`](https://docs.laravel-enso.com/backend/tables.html)
- [`laravel-enso/track-who`](https://docs.laravel-enso.com/backend/track-who.html)
- [`laravel-enso/users`](https://github.com/laravel-enso/users)

Companion frontend package:

- [`@enso-ui/audit`](https://docs.laravel-enso.com/frontend/audit.html) [↗](https://github.com/enso-ui/audit)

Contributions
-------------

[](#contributions)

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

License
-------

[](#license)

[MIT](https://github.com/laravel-enso/audit/blob/main/LICENSE)

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance94

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~5 days

Total

11

Last Release

27d ago

Major Versions

1.0.2 → 2.0.02026-04-29

PHP version history (2 changes)1.0.0PHP &gt;=8.0

2.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16073274?v=4)[Adrian Ocneanu](/maintainers/aocneanu)[@aocneanu](https://github.com/aocneanu)

---

Top Contributors

[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (8 commits)")[![vmcvlad](https://avatars.githubusercontent.com/u/37445394?v=4)](https://github.com/vmcvlad "vmcvlad (5 commits)")[![tedipop16](https://avatars.githubusercontent.com/u/71398467?v=4)](https://github.com/tedipop16 "tedipop16 (3 commits)")

---

Tags

Audithistoryaudit-loglaravel-enso

### Embed Badge

![Health badge](/badges/laravel-enso-audit/health.svg)

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

###  Alternatives

[laravel-enso/localisation

Language and translation management for Laravel Enso

1362.3k11](/packages/laravel-enso-localisation)[laravel-enso/core

The backend shell of a Laravel Enso application

3464.9k199](/packages/laravel-enso-core)[laravel-enso/data-import

Excel Importer dependency for Laravel Enso

2043.6k6](/packages/laravel-enso-data-import)[venturecraft/revisionable

Keep a revision history for your models without thinking, created as a package for use with Laravel

2.6k6.9M53](/packages/venturecraft-revisionable)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[laravel-enso/tutorials

Tutorial management backend for Laravel Enso

1140.4k](/packages/laravel-enso-tutorials)

PHPackages © 2026

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