PHPackages                             tatter/audits - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. tatter/audits

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

tatter/audits
=============

Lightweight object logging for CodeIgniter 4

v1.1.3(3y ago)1320.1k↓21.9%7[2 PRs](https://github.com/tattersoftware/codeigniter4-audits/pulls)3MITPHPPHP ^7.4 || ^8.0

Since Apr 7Pushed 2y ago4 watchersCompare

[ Source](https://github.com/tattersoftware/codeigniter4-audits)[ Packagist](https://packagist.org/packages/tatter/audits)[ Docs](https://github.com/tattersoftware/codeigniter4-audits)[ Fund](https://paypal.me/tatter)[ GitHub Sponsors](https://github.com/tattersoftware)[ RSS](/packages/tatter-audits/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (13)Used By (3)

Tatter\\Audits
==============

[](#tatteraudits)

Lightweight object logging for CodeIgniter 4

[![](https://github.com/tattersoftware/codeigniter4-audits/workflows/PHPUnit/badge.svg)](https://github.com/tattersoftware/codeigniter4-audits/actions/workflows/phpunit.yml)[![](https://github.com/tattersoftware/codeigniter4-audits/workflows/PHPStan/badge.svg)](https://github.com/tattersoftware/codeigniter4-audits/actions/workflows/phpstan.yml)[![](https://github.com/tattersoftware/codeigniter4-audits/workflows/Deptrac/badge.svg)](https://github.com/tattersoftware/codeigniter4-audits/actions/workflows/deptrac.yml)[![Coverage Status](https://camo.githubusercontent.com/593757900bf714a70023d293a5f06c35ca1c2571f1e7b747f8547be578572708/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f746174746572736f6674776172652f636f646569676e69746572342d6175646974732f62616467652e7376673f6272616e63683d646576656c6f70)](https://coveralls.io/github/tattersoftware/codeigniter4-audits?branch=develop)

Quick Start
-----------

[](#quick-start)

1. Install with Composer: `> composer require tatter/audits`
2. Update the database: `> php spark migrate --all`
3. Set up your models:

```
use Tatter\Audits\Traits\AuditsTrait;

class JobModel extends Model
{
	use AuditsTrait;
	protected $afterInsert = ['auditInsert'];
	protected $afterUpdate = ['auditUpdate'];
	protected $afterDelete = ['auditDelete'];
```

Features
--------

[](#features)

Provides ready-to-use object logging for CodeIgniter 4

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

[](#installation)

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

```
> composer require tatter/audits
```

Or, install manually by downloading the source files and adding the directory to `app/Config/Autoload.php`.

Once the files are downloaded and included in the autoload, run any library migrations to ensure the database is setup correctly:

```
> php spark migrate --all
```

Configuration (optional)
------------------------

[](#configuration-optional)

The library's default behavior can be altered by extending its config file. Copy **examples/Audits.php** to **app/Config/Audits.php** and follow the instructions in the comments. If no config file is found in **app/Config** the library will use its own.

Usage
-----

[](#usage)

Once the library is included all the resources are ready to go and you just need to specify which models and events to audit. Use AuditsTrait to add support to any models you would like tracked:

```
use Tatter\Audits\Traits\AuditsTrait;

class JobModel extends Model
{
	use AuditsTrait;
```

Then specify which events you want audited by assigning the corresponding audit methods for those events:

```
	protected $afterInsert = ['auditInsert'];
	protected $afterUpdate = ['auditUpdate'];
	protected $afterDelete = ['auditDelete'];
```

The Audits library will create basic logs of each event in the `audits` table, for example:

```
| id | source | source_id | user_id | event  | summary  |          created_at |
+----+--------+-----------+---------+--------+----------+---------------------+
| 10 | sites  |        27 |       9 | create | 2 rows   | 2019-04-05 15:58:40 |
| 11 | jobs   |        10 |       9 | update | 5 rows   | 2019-04-05 16:01:35 |

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 97.6% 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 ~130 days

Recently: every ~177 days

Total

10

Last Release

1427d ago

PHP version history (4 changes)v1.0.0PHP ^7.0

v1.0.4PHP &gt;=7.2

v1.1.0PHP ^7.3 || ^8.0

v1.1.3PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ebe908b4fe73807ecdd9f88733342199c9991b7de800329f5b2b787c8210d62?d=identicon)[MGatner](/maintainers/MGatner)

---

Top Contributors

[![MGatner](https://avatars.githubusercontent.com/u/17572847?v=4)](https://github.com/MGatner "MGatner (41 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

loggingeventscodeigniterAuditcodeigniter4

### Embed Badge

![Health badge](/badges/tatter-audits/health.svg)

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

###  Alternatives

[bedezign/yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.

201657.4k4](/packages/bedezign-yii2-audit)[muhammadsadeeq/laravel-activitylog-ui

A beautiful, modern UI for Spatie's Activity Log with advanced filtering, analytics, and real-time features.

17510.1k](/packages/muhammadsadeeq-laravel-activitylog-ui)[tatter/outbox

Email toolkit for CodeIgniter 4

178.6k](/packages/tatter-outbox)[cornernote/yii-audit-module

Track and store usage information including page requests, database field changes and system errors.

226.6k](/packages/cornernote-yii-audit-module)

PHPackages © 2026

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