PHPackages                             rrvwmrrr/little-auditor - 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. rrvwmrrr/little-auditor

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

rrvwmrrr/little-auditor
=======================

Mimimal auditing package for Laravel

08PHP

Since May 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/rrvwmrrr/little-auditor)[ Packagist](https://packagist.org/packages/rrvwmrrr/little-auditor)[ RSS](/packages/rrvwmrrr-little-auditor/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Little Auditor - The littlest Laravel auditor](little-auditor-banner.png)](little-auditor-banner.png)

Little Auditor
==============

[](#little-auditor)

[![Latest Version on Packagist](https://camo.githubusercontent.com/eacf0c0a3e701c5b613792579e90d1593c5b0d143343067c7860d797e15e5851/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f727276776d7272722f6c6974746c652d61756469746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rrvwmrrr/little-auditor)[![GitHub Tests Action Status](https://camo.githubusercontent.com/5af760fb75cd8d93f9ac3e0fd4bee545f750bb283ffd0fb3b5c3d5732657da94/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f727276776d7272722f6c6974746c652d61756469746f722f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/rrvwmrrr/little-auditor/actions?query=workflow%3ATests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/0c28ce6af8c704055f6a2ac0bbeef8137f534017a1ee504273867f1bb9963de2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f727276776d7272722f6c6974746c652d61756469746f722f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/rrvwmrrr/little-auditor/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/4828ea053f11976849cec10695e3a436a4d589fb1434c95edd275d0b831a2f97/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f727276776d7272722f6c6974746c652d61756469746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rrvwmrrr/little-auditor)

Little auditor contains a pair of traits you can apply to your [Eloquent](https://laravel.com/docs/8.x/eloquent) models to allow you to hook in to their events and store the attached data.

Should I use this package?
--------------------------

[](#should-i-use-this-package)

No. It's not ready yet.

Who should consider this package?
---------------------------------

[](#who-should-consider-this-package)

There are no extra functionalities here, we're just keeping track of a model, changes that have been made to it and the user that made them.

If you need fully fledged auditing functionality, I'd recommend [Laravel Auditing](https://github.com/owen-it/laravel-auditing).

Auditing
--------

[](#auditing)

If you've turned off package discovery, you'll need to register the Audit service provider in your app config.

```
    'providers' => [
        ...
        Rrvwmrrr\Auditor\AuditServiceProvider::class,
        ...

    ]
```

### Setting up an auditor

[](#setting-up-an-auditor)

The auditor will always attempt to grab the logged in user id and attach that to an audit. The default auditor is mapped to `App\Models\User` but can be changed via a service provivider if you're authenticating with a different model.

```
// app/Providers/AppServiceProvider.php

use Rrvwmrrr\Auditor\Auditor;

public function boot()
{
    Auditor::$auditorModel = Some\Other\Class::class;
}
```

Now that we've configured the model for our Auditor, let's set up the trait on that model.

```
// app/Models/User.php

use Rrvwmrrr\Auditor\Traits\IsAuditor;

class User extends Authenticatable
{
    use IsAuditor;
```

### Setting up auditable models

[](#setting-up-auditable-models)

Finally, we need to apply the auditing trait for the models we want to track changes on.

```
// app/Models/Order.php

use Rrvwmrrr\Auditor\Traits\IsAudited;

class Order
{
    use IsAudited;
}
```

### Defaults

[](#defaults)

By default, the IsAudited trait will try to listen for all model events. This can be customized via each model using the audit property

```
// app/Models/Order.php

use Rrvwmrrr\Auditor\Traits\IsAudited;

class Order
{
    use IsAudited;

    /**
     * The model events to listen for
     *
     * @var array
     */
    protected $audit = [
        'saved',
    ];
}
```

This set up would only save audit information when the saved event is fired for the model.

### Audit relationships

[](#audit-relationships)

Audits can now be queried on both the user model (retreiving everything they've audited) and any auditable model.

```
    $user = User::find(1);
    $user->audits;   //  Collection of audits made by the user

    $order = Order::find(1);
    $order->audits; //  Collection of audits made on the order
```

Testing
-------

[](#testing)

```
composer test
```

Contributors
------------

[](#contributors)

- [James Sessford](https://github.com/jamessessford)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](license.md) for more information.

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17096446?v=4)[James Sessford](/maintainers/jamessessford)[@jamessessford](https://github.com/jamessessford)

---

Top Contributors

[![jamessessford](https://avatars.githubusercontent.com/u/17096446?v=4)](https://github.com/jamessessford "jamessessford (60 commits)")

---

Tags

auditingeloquentlaravel

### Embed Badge

![Health badge](/badges/rrvwmrrr-little-auditor/health.svg)

```
[![Health](https://phpackages.com/badges/rrvwmrrr-little-auditor/health.svg)](https://phpackages.com/packages/rrvwmrrr-little-auditor)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)

PHPackages © 2026

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