PHPackages                             laraarabdev/recordkeeper - 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. laraarabdev/recordkeeper

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

laraarabdev/recordkeeper
========================

Headless audit trail and rollback for any Laravel app — PHP 8 attributes, route auditing, privacy protection, and Artisan tools. No Filament required.

v0.1.1(1mo ago)061MITPHP ^8.2

Since Jul 7Compare

[ Source](https://github.com/LaraArabDev/recordkeeper)[ Packagist](https://packagist.org/packages/laraarabdev/recordkeeper)[ Docs](https://github.com/LaraArabDev/recordkeeper)[ RSS](/packages/laraarabdev-recordkeeper/feed)WikiDiscussions Synced 1w ago

READMEChangelog (1)Dependencies (26)Versions (9)Used By (1)

 [![Recordkeeper Banner](art/banner.svg)](art/banner.svg)

Recordkeeper
============

[](#recordkeeper)

 **Headless audit trail, rollback &amp; data protection for Laravel**

 [![Latest Version](https://camo.githubusercontent.com/382e9cccf01f40d279d62f6a6b58be407437ee438d207f7e718c06188a02f2fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c617261617261626465762f7265636f72646b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraarabdev/recordkeeper) [![Total Downloads](https://camo.githubusercontent.com/b01e6a76cc9087966705c0e8f4e7393129075e486da857327b2fdc27630d7e16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c617261617261626465762f7265636f72646b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraarabdev/recordkeeper) [![License](https://camo.githubusercontent.com/2e32ac2b6e69ca56f38ec37108bfa2319bb0356bfd87f824c919d64c11d01140/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c617261617261626465762f7265636f72646b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraarabdev/recordkeeper) [![PHP](https://camo.githubusercontent.com/a19fecebacb1b3ee69cde924acfbccf8870bf33fdb6250fa19c9e9ecf8826510/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c617261617261626465762f7265636f72646b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraarabdev/recordkeeper) [![Laravel](https://camo.githubusercontent.com/cbb595b2b71f832273222f76609c6a1063da114182c230410090158421b8c265/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312e7825323025374325323031322e782d7265643f7374796c653d666c61742d737175617265)](https://laravel.com)

 [![Tests](https://camo.githubusercontent.com/ffcf932b3d8f20546a84e4d6304e0c93054a618545f4e87e19aee437ffcf040f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f7265636f72646b65657065722f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/recordkeeper/actions/workflows/tests.yml) [![codecov](https://camo.githubusercontent.com/1cffb4d92a41e4b15b71d1ded54b7bb5efbd695cbb65aceab39b8c20fa56f381/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f4c617261417261624465762f7265636f72646b65657065723f7374796c653d666c61742d737175617265)](https://codecov.io/gh/LaraArabDev/recordkeeper) [![Static Analysis](https://camo.githubusercontent.com/e3ba9597812a958087e516cf3b8da46792f97bba283ddd6e6ea5d8afaa5efce6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f7265636f72646b65657065722f7374617469632d616e616c797369732e796d6c3f6272616e63683d6d61696e266c6162656c3d7068707374616e267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/recordkeeper/actions/workflows/static-analysis.yml) [![Security Audit](https://camo.githubusercontent.com/bc998b0cb5dbe7369371e4c18f08cfce79fbef8208ee02a554623732ebcebf60/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f7265636f72646b65657065722f73656375726974792e796d6c3f6272616e63683d6d61696e266c6162656c3d7365637572697479267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/recordkeeper/actions/workflows/security.yml) [![Mutation Testing](https://camo.githubusercontent.com/093d3b057d803fd0c7458e504f78db879784678872ee76558ca4ffe238305397/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f7265636f72646b65657065722f6d75746174696f6e2d74657374696e672e796d6c3f6272616e63683d6d61696e266c6162656c3d696e66656374696f6e267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/recordkeeper/actions/workflows/mutation-testing.yml) [![Code Style](https://camo.githubusercontent.com/dd64426df742fb44edb0857533a67ce5c8602212624a57f410604b649be8ea26/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f7265636f72646b65657065722f636f64652d7374796c652e796d6c3f6272616e63683d6d61696e266c6162656c3d70696e74267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/recordkeeper/actions/workflows/code-style.yml)

 Track every model change, route hit, queued job, Artisan command, and application event — with one-click rollback, privacy controls, and zero config arrays.
 Built on [owen-it/laravel-auditing](https://laravel-auditing.com/) · PHP 8.2 – 8.4 · Laravel 11 / 12

 **[LaraArabDev](https://github.com/LaraArabDev)** — We build, develop, empower, and contribute. An Arab open-source community crafting production-grade Laravel packages.
 **[LaraArabDev](https://github.com/LaraArabDev)** — نبني، نطوّر، نُمكّن، ونُساهم. مجتمع عربي مفتوح المصدر يصنع حزم Laravel احترافية وجاهزة للإنتاج.

 [Quick Start](#-quick-start) · [Attributes](#-php-8-attributes) · [Rollback](#-rollback) · [Commands](#-artisan-commands) · [العربية](#-العربية)

---

What is Recordkeeper?
---------------------

[](#what-is-recordkeeper)

Recordkeeper is a **Laravel package** that gives your application a complete audit trail — tracking **who** did **what**, **when**, and the ability to **undo it**. It goes far beyond simple model change tracking:

- **Model auditing** — every create, update, delete, and restore is logged automatically with before/after values
- **Route &amp; API auditing** — log every HTTP request with actor, guard, IP, timing, and status code
- **Job lifecycle tracking** — follow queued jobs from dispatch through processing to completion or failure
- **Artisan command auditing** — track command execution with duration, memory usage, and anomaly detection
- **Application event auditing** — capture custom events with full payload
- **Outbound HTTP tracking** — record every external API call your jobs make
- **Privacy protection** — auto-redact sensitive fields (passwords, tokens, SSNs) and AES-encrypt recoverable fields
- **One-click rollback** — revert any change (single or batch) with dry-run preview
- **8 Artisan commands** — search, show, tail, stats, rollback, prune, export, and model discovery from the CLI
- **4 storage drivers** — database, Redis, log, or null for testing

All configured through clean **PHP 8 Attributes** — no config arrays to maintain.

> **Built on top of [owen-it/laravel-auditing](https://laravel-auditing.com/)** — the most popular audit package in the Laravel ecosystem. Recordkeeper installs it automatically as a dependency. If you already use `laravel-auditing`, Recordkeeper is a drop-in enhancement — your existing auditable models keep working.

---

Why Recordkeeper over plain laravel-auditing?
---------------------------------------------

[](#why-recordkeeper-over-plain-laravel-auditing)

Featurelaravel-auditing alone+ RecordkeeperModel CRUD trackingYesYesRoute &amp; API auditingNo**Built-in middleware**Job lifecycle trackingNo**queued → processing → done/failed**Artisan command auditingNo**With anomaly detection**Event auditingNo**Opt-in with payload capture**Outbound HTTP trackingNo**Linked to parent job**ConfigurationPHP config arrays**PHP 8 Attributes**Privacy protectionManual exclusions**Auto-redact + AES encrypt**Rollback`transitionTo()` manual**One-click + batch + dry-run**CLI toolsNo**8 Artisan commands**Storage backendsDatabase only**4 drivers**---

🚀 Quick Start
-------------

[](#-quick-start)

### Install

[](#install)

```
composer require laraarabdev/recordkeeper
php artisan recordkeeper:install
php artisan migrate
```

### Add the trait — done

[](#add-the-trait--done)

```
class Order extends Model implements \OwenIt\Auditing\Contracts\Auditable
{
    use AuditsChanges;  // tracks creates, updates, deletes automatically
}
```

### Audit API routes

[](#audit-api-routes)

```
Route::middleware('audit.api')->apiResource('orders', OrderController::class);
```

### Protect sensitive data

[](#protect-sensitive-data)

```
#[Redact('cvv')]              // stored as ***
#[Encrypt('national_id')]     // AES-encrypted, recoverable on rollback
class Payment extends Model { ... }
```

### Undo a mistake

[](#undo-a-mistake)

```
Recordkeeper::rollback($auditId);
```

**No boilerplate. No custom middleware.** Just attributes, traits, and you're auditing.

---

📄 Default Configuration
-----------------------

[](#-default-configuration)

After running `php artisan recordkeeper:install`, a `config/recordkeeper.php` file is published. Here are the **defaults out of the box** — everything works with zero changes:

SettingDefaultWhat it means`enabled``true`Auditing is active`events``['created', 'updated', 'deleted', 'restored']`All CRUD events tracked`driver``'database'`Audits stored in `audits` table`privacy.mode``'redact'`Sensitive fields auto-redacted with `***``privacy.global_exclude``['password', 'remember_token']`Never stored in any audit`rollback.enabled``true`Rollback feature active`queue.enabled``false`Sync writes (enable for async)`jobs.enabled``false`Opt-in per job or enable globally`commands.enabled``false`Opt-in per command or enable globally`routes.enabled``false`Global route auditing (all web/api routes)`http.enabled``false`Outbound HTTP tracking off by default`retention.default_days``0`Keep audits forever (set a number to auto-prune)`strict``false`Failed writes log silently (enable in tests to throw)### Full config file

[](#full-config-file)

**config/recordkeeper.php**```
