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

ActiveLibrary

laraarabdev/recordkeeper-filament
=================================

Filament 5 admin UI for laraarabdev/recordkeeper — audit resource, before/after diff viewer, timeline, stats widget, and permission-gated rollback.

v0.8.0(1mo ago)00MITPHPPHP ^8.2CI failing

Since Jun 29Pushed 1mo agoCompare

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

READMEChangelog (10)Dependencies (8)Versions (13)Used By (0)

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

Filament Recordkeeper
=====================

[](#filament-recordkeeper)

 **Admin UI for audit trails, rollback &amp; data protection in Filament**

 [![Latest Version](https://camo.githubusercontent.com/68c4adc1c2ac6ee4d63c15498ceec276372a49ad9b0f3cba80da6d95f622f7a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c617261617261626465762f66696c616d656e742d7265636f72646b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraarabdev/filament-recordkeeper) [![Total Downloads](https://camo.githubusercontent.com/b49ba01bad0da800e53bf2acf50c0d9e1d476de9a966305b8f0b463b476470bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c617261617261626465762f66696c616d656e742d7265636f72646b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraarabdev/filament-recordkeeper) [![License](https://camo.githubusercontent.com/5b530f29a15a53cfe3691880b956e3855ebf919025336ed9d0f4990794bf431c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c617261617261626465762f66696c616d656e742d7265636f72646b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraarabdev/filament-recordkeeper) [![PHP](https://camo.githubusercontent.com/bb12edb83477dd5970f432298494a412cbf61a55255523666cd650247d1b582f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c617261617261626465762f66696c616d656e742d7265636f72646b65657065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraarabdev/filament-recordkeeper) [![Filament](https://camo.githubusercontent.com/8dd33ec0333bc5ef4a97d4e262cf7a86b282128d4b958553e3ac5c78335ab923/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f66696c616d656e742d352e782d6f72616e67653f7374796c653d666c61742d737175617265)](https://filamentphp.com) [![Laravel](https://camo.githubusercontent.com/cbb595b2b71f832273222f76609c6a1063da114182c230410090158421b8c265/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31312e7825323025374325323031322e782d7265643f7374796c653d666c61742d737175617265)](https://laravel.com)

 [![Tests](https://camo.githubusercontent.com/ec54b6a61ba815b6065d1742065f9083e9dd4f000260fc147f441a95992a0df6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f66696c616d656e742d7265636f72646b65657065722f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/filament-recordkeeper/actions/workflows/tests.yml) [![codecov](https://camo.githubusercontent.com/3054151ae28da7268600059f46c839694811e2e0aff97875ad82fa7785e864c6/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f4c617261417261624465762f66696c616d656e742d7265636f72646b65657065723f7374796c653d666c61742d737175617265)](https://codecov.io/gh/LaraArabDev/filament-recordkeeper) [![Static Analysis](https://camo.githubusercontent.com/ca0194b8a3511a098d5b6a86b3e570aa2ccd0e6c0bf7a09d2c102d3b81c8e32a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f66696c616d656e742d7265636f72646b65657065722f7374617469632d616e616c797369732e796d6c3f6272616e63683d6d61696e266c6162656c3d7068707374616e267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/filament-recordkeeper/actions/workflows/static-analysis.yml) [![Security Audit](https://camo.githubusercontent.com/6726f40e879e6d5c7d8879ce4cf6f619faf1b05efcd71ee731f8a05ce907b9e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f66696c616d656e742d7265636f72646b65657065722f73656375726974792e796d6c3f6272616e63683d6d61696e266c6162656c3d7365637572697479267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/filament-recordkeeper/actions/workflows/security.yml) [![Code Style](https://camo.githubusercontent.com/9354cc49080226c51a3829d68c2db6de8bd97bbe8c4dd7c84a600a2a07bf7189/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4c617261417261624465762f66696c616d656e742d7265636f72646b65657065722f636f64652d7374796c652e796d6c3f6272616e63683d6d61696e266c6162656c3d70696e74267374796c653d666c61742d737175617265)](https://github.com/LaraArabDev/filament-recordkeeper/actions/workflows/code-style.yml)

 A Filament 5 plugin that gives you a full admin UI on top of [`laraarabdev/recordkeeper`](https://github.com/LaraArabDev/recordkeeper) — browse audits, view diffs, rollback changes, and monitor command performance from your panel.
 PHP 8.2 – 8.4 · Laravel 11 / 12 · Filament 5

 **[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) · [Plugin API](#-plugin-api) · [Audit Resource](#-audit-resource) · [Widgets](#-widgets) · [Relation Manager](#-relation-manager) · [العربية](#-العربية)

---

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

[](#what-is-filament-recordkeeper)

Filament Recordkeeper is a **Filament 5 plugin** that provides a complete admin UI for the [`laraarabdev/recordkeeper`](https://github.com/LaraArabDev/recordkeeper) audit package. It turns your raw audit data into a browseable, filterable, and actionable admin experience:

- **Audit Resource** — paginated table with event tabs, global search, 8 filters, and inline revert action
- **View Page** — before/after diff viewer with color-coded changes, context metadata, outbound HTTP requests, and permission-gated rollback with dry-run preview
- **Stats Widget** — six dashboard stat cards showing audit counts by event type and distinct actors
- **Timeline Widget** — recent audit activity feed showing the latest 20 entries
- **Command Metrics Widget** — dual-axis bar chart visualizing command duration and audit impact with anomaly detection
- **Relation Manager** — embeddable audit history tab for any Filament resource
- **HasAuditHistory Trait** — one line to add the audit history tab to your resource

> **Only need headless audit + rollback (API / no admin panel)?** Install [`laraarabdev/recordkeeper`](https://github.com/LaraArabDev/recordkeeper) directly — this package is just the Filament presentation layer on top of it. All auditing logic, privacy controls, rollback engine, Artisan commands, and storage drivers come from the core package.

---

📦 Prerequisites
---------------

[](#-prerequisites)

RequirementVersionPHP8.2, 8.3, or 8.4Laravel11 or 12Filament5.xlaraarabdev/recordkeeper^1.0 (auto-installed)---

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

[](#-quick-start)

### Install

[](#install)

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

The core `laraarabdev/recordkeeper` package is installed automatically as a dependency — no need to install it separately.

### Register the plugin

[](#register-the-plugin)

Add the plugin to your Filament panel provider:

```
use LaraArabDev\RecordkeeperFilament\RecordkeeperPlugin;

public function panel(Panel $panel): Panel
{
    return $panel->plugins([
        RecordkeeperPlugin::make(),
    ]);
}
```

That's it — the audit resource is now available in your panel sidebar.

### Enable features

[](#enable-features)

All widgets and rollback are opt-in. Enable what you need:

```
RecordkeeperPlugin::make()
    ->enableRollback()           // show rollback action on audit view
    ->enableStatsWidget()        // register stats overview widget
    ->enableTimeline()           // register timeline widget
    ->enableCommandMetrics()     // register command performance chart
```

### Add audit history to resources

[](#add-audit-history-to-resources)

```
use LaraArabDev\RecordkeeperFilament\Concerns\HasAuditHistory;

class OrderResource extends Resource
{
    use HasAuditHistory;
}
```

This adds a "History" tab with an audit table on every order's detail page.

---

⚙️ Plugin API
-------------

[](#️-plugin-api)

Configure everything through a fluent builder — all methods return `$this` for chaining:

```
RecordkeeperPlugin::make()
    ->enableRollback()                          // show rollback button
    ->enableStatsWidget()                       // stats dashboard widget
    ->enableTimeline()                          // timeline dashboard widget
    ->enableCommandMetrics()                    // command chart widget
    ->navigationGroup('Audit')                  // sidebar group label
    ->navigationSort(50)                        // sidebar sort order
    ->navigationIcon('heroicon-o-shield-check') // sidebar icon
    ->cluster(AuditCluster::class)              // assign to a Filament cluster
    ->pollingInterval('30s')                    // live-refresh widgets
```

### All methods

[](#all-methods)

MethodDefaultDescription`enableRollback(bool)``false`Show the rollback/revert button on the audit detail page and inline on list rows. Requires `recordkeeper.rollback.enabled` to also be `true` in the core config.`enableStatsWidget(bool)``false`Register the `AuditStatsOverview` widget on the panel dashboard.`enableTimeline(bool)``false`Register the `AuditTimeline` widget on the panel dashboard.`enableCommandMetrics(bool)``false`Register the `CommandMetricsWidget` on the panel dashboard. Only visible when `recordkeeper.commands.metrics.memory` or `recordkeeper.commands.metrics.audit_count` is enabled.`navigationGroup(string)``'Audit'`Sidebar navigation group label for the audit resource.`navigationSort(int)``100`Sort order of the audit resource in the sidebar.`navigationIcon(string)``'heroicon-o-clock'`Heroicon name displayed next to the audit resource in the sidebar.`cluster(string)``null`Fully-qualified class name of a Filament cluster to assign the resource to.`pollingInterval(string)``null`Livewire polling interval for widgets (e.g. `'30s'`, `'10s'`). `null` disables polling.### How configuration flows

[](#how-configuration-flows)

The plugin writes its settings into Laravel's runtime config at boot:

```
RecordkeeperPlugin::make()->enableRollback()
    ↓
config('recordkeeper.filament.rollback_enabled') = true
    ↓
AuditResource / ViewAudit reads config to show/hide revert button

```

This means you can also override values via `config/recordkeeper.php` if you prefer config files over the builder API.

---

📋 Audit Resource
----------------

[](#-audit-resource)

The audit resource is the main page of the plugin — a full Filament resource backed by the `Audit` model.

### List page

[](#list-page)

**URL:** `/admin/audits` (or your panel path)

The list page provides:

- **Event tabs** — filter by All, Created, Updated, Deleted, and Routes with badge counts (powered by a single optimized SQL query using conditional aggregation)
- **Sortable columns** — Time (relative with ISO tooltip), Event (color-coded badge), Subject (`ModelName #ID`), Actor (`UserType #ID` or `system`), Guard, Batch ID, IP, URL
- **Toggle columns** — Guard, Batch ID, IP, and URL are hidden by default, toggleable from the column picker
- **Global search** — search across event name, auditable type, and batch ID
- **Default sort** — newest first (`created_at DESC`)

### Filters

[](#filters)

The list page has 8 filters across 2 columns:

FilterTypeDescription**Event**Multi-selectFilter by event names (auto-populated from existing audits)**Model**Multi-selectFilter by auditable type (shows short class name)**Guard**SelectFilter by authentication guard (`web`, `api`, etc.)**Actor type**SelectFilter by user type (shows short class name)**Actor ID**Text inputFilter by specific user ID**Period**Date rangeFilter by date range (from / until)**Batch ID**Text inputFilter by batch identifier**Rollbackable**TernaryShow only rollbackable / non-rollbackable / allFilters persist in the session — they survive page navigation and browser refresh.

### Row actions

[](#row-actions)

ActionIconDescription**View**EyeNavigate to the audit detail page**Revert**Arrow U-turnRollback this single audit (requires confirmation). Only visible when rollback is enabled and the audit is rollbackable (`created`, `updated`, `deleted`, `restored`).### Bulk actions

[](#bulk-actions)

ActionDescription**Prune selected**Delete selected audit records. Only visible to users with the `prune_audits` permission.### View page

[](#view-page)

**URL:** `/admin/audits/{id}`

The detail page shows four sections:

#### 1. Overview

[](#1-overview)

3-column layout with: Event (badge), Subject (`Model #ID`), Actor, Guard (badge), IP address, Time (full datetime), and Batch ID.

#### 2. Changes

[](#2-changes)

Side-by-side key-value display:

- **Before** — `old_values` (the state before the change)
- **After** — `new_values` (the state after the change)

#### 3. Context

[](#3-context)

Key-value display of the `context` JSON column. Only visible when context data exists. Contains route info, duration, command metrics, or any custom context pushed via `Recordkeeper::pushContext()`.

#### 4. Outbound HTTP Requests

[](#4-outbound-http-requests)

A repeatable table showing all HTTP requests made during this audit's context (e.g. API calls made by a job). Shows: Method (badge), URL, Status Code (color-coded: green &lt; 300, yellow &lt; 400, red &gt;= 400), Duration (ms), and Failed status. Only visible when `recordkeeper.http.enabled` is `true` and the audit has associated HTTP request records.

#### Rollback action

[](#rollback-action)

The view page has a header action button **"Revert this change"** that:

1. Shows a dry-run preview modal with the changes that will be reverted
2. Requires confirmation before applying
3. Only visible when: the record is a model audit (`created`, `updated`, `deleted`), rollback is enabled in the plugin, AND rollback is enabled in core config

### Event color coding

[](#event-color-coding)

Events are color-coded consistently throughout the entire UI:

EventColorBadge`created`Green (`success`)`updated`Yellow (`warning`)`deleted` / `forceDeleted`Red (`danger`)`route.*`Blue (`info`)All othersGray (`gray`)### Guard color coding

[](#guard-color-coding)

GuardColor`web`Gray`api`Blue (`info`)OtherYellow (`warning`)---

📊 Widgets
---------

[](#-widgets)

All widgets are opt-in — register them via the plugin builder. They appear on your Filament dashboard.

### Stats Overview

[](#stats-overview)

Six stat cards with aggregate audit counts:

CardIconColorValueTotal AuditsClock—Total count of all audit recordsCreatedPlus CircleGreenCount of `created` eventsUpdatedPencilYellowCount of `updated` eventsDeletedTrashRedCount of `deleted` + `forceDeleted` eventsRoute HitsGlobeBlueCount of `route.*` eventsDistinct ActorsUsers—Count of unique `user_id` values**Performance:** Uses a single SQL query with conditional aggregation (`SUM(CASE WHEN ...)`) instead of 6 separate `COUNT` queries.

```
RecordkeeperPlugin::make()
    ->enableStatsWidget()
```

### Audit Timeline

[](#audit-timeline)

A full-width table widget showing the 20 most recent audit entries. Not paginated — designed as a quick activity feed.

Columns: Time (relative), Event (color-coded badge), Subject (`Model #ID`), Actor (`UserType #ID` or `system`).

```
RecordkeeperPlugin::make()
    ->enableTimeline()
```

### Command Metrics

[](#command-metrics)

A dual-axis bar chart visualizing Artisan command performance:

- **Left Y-axis (bars):** Command execution duration in milliseconds
- **Right Y-axis (line):** Audit impact count (number of audits generated by the command)
- **X-axis:** Last 14 runs of the selected command
- **Anomaly detection:** Bars turn red when the run was flagged as anomalous
- **Filter dropdown:** Select which command to visualize (auto-populated from recent command audits)

Only visible when at least one command metrics config option is enabled in `recordkeeper.commands.metrics`.

```
RecordkeeperPlugin::make()
    ->enableCommandMetrics()
```

---

🔗 Relation Manager
------------------

[](#-relation-manager)

The `AuditsRelationManager` provides an embeddable audit history tab for any Filament resource. It connects via the `audits` morphMany relationship on the parent model.

### What it shows

[](#what-it-shows)

ColumnDescriptionTimeRelative timestamp (`since()`)EventColor-coded badgeActor`UserType #ID` or `system`### Actions per row

[](#actions-per-row)

ActionDescription**View**Opens the full audit detail page in a new tab**Revert**Rollback this change (with confirmation). Only visible when rollback is enabled and the audit is rollbackable.### Usage — HasAuditHistory trait

[](#usage--hasaudithistory-trait)

The simplest way to add the relation manager:

```
use LaraArabDev\RecordkeeperFilament\Concerns\HasAuditHistory;

class OrderResource extends Resource
{
    use HasAuditHistory;
}
```

The trait merges `AuditsRelationManager` into the resource's `getRelationManagers()` array, so it works alongside any existing relation managers you have.

### Usage — manual registration

[](#usage--manual-registration)

If you prefer explicit control:

```
use LaraArabDev\RecordkeeperFilament\RelationManagers\AuditsRelationManager;

class OrderResource extends Resource
{
    public static function getRelationManagers(): array
    {
        return [
            AuditsRelationManager::class,
        ];
    }
}
```

### Prerequisites

[](#prerequisites)

Your model must have the `audits` relationship. If your model uses the core `AuditsChanges` trait (or implements `OwenIt\Auditing\Contracts\Auditable`), this relationship already exists.

---

🎨 Customizing Views
-------------------

[](#-customizing-views)

The plugin ships with a Blade view for the rollback preview modal. You can publish and customize it:

```
php artisan vendor:publish --tag=recordkeeper-filament-views
```

This copies the views to `resources/views/vendor/recordkeeper/` where you can modify them.

---

🏗️ Architecture
---------------

[](#️-architecture)

This package is a **pure Filament presentation layer**. It contains zero business logic — everything is delegated to the core `laraarabdev/recordkeeper` package:

```
┌─────────────────────────────────────────────────┐
│  filament-recordkeeper (this package)            │
│                                                  │
│  RecordkeeperPlugin     → Filament plugin API    │
│  AuditResource          → List + View pages      │
│  AuditStatsOverview     → Stats widget           │
│  AuditTimeline          → Timeline widget        │
│  CommandMetricsWidget   → Chart widget           │
│  AuditsRelationManager  → Embeddable history tab │
│  HasAuditHistory        → One-line trait          │
│  AuditFormatter         → Shared UI helpers       │
│  ServiceProvider        → Views only              │
└───────────────┬─────────────────────────────────┘
                │ depends on
┌───────────────▼─────────────────────────────────┐
│  recordkeeper (core package)                     │
│                                                  │
│  Audit model, rollback engine, privacy pipeline, │
│  PHP 8 attributes, Artisan commands, middleware,  │
│  storage drivers, job/command/event tracking      │
└─────────────────────────────────────────────────┘

```

### File structure

[](#file-structure)

```
src/
├── Concerns/
│   └── HasAuditHistory.php          # Trait — adds relation manager to resources
├── RelationManagers/
│   └── AuditsRelationManager.php    # Embeddable audit history tab
├── Resources/
│   ├── AuditResource.php            # Main resource (table + infolist)
│   └── Pages/
│       ├── ListAudits.php           # List page with event tabs
│       └── ViewAudit.php            # Detail page with rollback action
├── Support/
│   └── AuditFormatter.php           # Event colors, actor/subject labels, canRevert
├── Widgets/
│   ├── AuditStatsOverview.php       # Stats dashboard widget
│   ├── AuditTimeline.php            # Recent activity table widget
│   └── CommandMetricsWidget.php     # Command performance chart
├── RecordkeeperPlugin.php           # Filament plugin (builder API)
└── RecordkeeperFilamentServiceProvider.php  # Views bootstrap

```

---

🔐 Rollback — How It Works in the UI
-----------------------------------

[](#-rollback--how-it-works-in-the-ui)

Rollback is **disabled by default** and requires two conditions to be met:

1. **Plugin level:** `RecordkeeperPlugin::make()->enableRollback()`
2. **Core level:** `config('recordkeeper.rollback.enabled')` must be `true` (default)

When both are enabled, the revert button appears in three places:

LocationBehavior**List page row action**Inline revert with confirmation dialog**View page header action**Revert with dry-run preview modal showing before/after changes**Relation manager row action**Inline revert with confirmation dialogOnly rollbackable events show the revert button: `created`, `updated`, `deleted`, `restored`.

Original EventWhat Rollback Does`created`Force-deletes the model`updated`Restores old values`deleted`Restores the model (supports SoftDeletes)---

🧪 Testing
---------

[](#-testing)

```
composer test
```

The test suite covers the plugin builder API, service provider registration, `AuditFormatter` helpers, relation manager configuration, and widget setup.

---

📖 Core Package Documentation
----------------------------

[](#-core-package-documentation)

All auditing logic lives in the core [`laraarabdev/recordkeeper`](https://github.com/LaraArabDev/recordkeeper) package. See its README for:

- Model setup with `AuditsChanges` trait
- PHP 8 Attributes (`#[Auditable]`, `#[Redact]`, `#[Encrypt]`, `#[AuditJob]`, `#[AuditCommand]`, `#[AuditEvent]`)
- Route &amp; API auditing middleware
- Global route auditing (`RECORDKEEPER_ROUTES=true`)
- Outbound HTTP tracking (`RECORDKEEPER_HTTP=true`)
- Job, command, and event lifecycle tracking
- Privacy protection (auto-redact + AES encrypt)
- Rollback API and batch operations
- Fluent query builder
- 8 Artisan commands
- 4 storage drivers (database, Redis, log, null)
- Full configuration reference

---

🔐 Security
----------

[](#-security)

Please review [our security policy](SECURITY.md) on how to report security vulnerabilities.

---

📄 Credits &amp; License
-----------------------

[](#-credits--license)

- [LaraArabDev](https://github.com/LaraArabDev)
- [All Contributors](../../contributors)

MIT License — see [LICENSE](LICENSE) for details.

---

🇸🇦 العربية
----------

[](#-العربية)

### ما هو Filament Recordkeeper؟

[](#ما-هو-filament-recordkeeper)

**Filament Recordkeeper** هو إضافة (Plugin) لـ Filament 5 توفّر واجهة إدارة كاملة فوق حزمة [`laraarabdev/recordkeeper`](https://github.com/LaraArabDev/recordkeeper) للتدقيق. تحوّل بيانات التدقيق الخام إلى تجربة إدارية قابلة للتصفح والفلترة والتفاعل.

> **لا تحتاج لوحة إدارة؟** ثبّت [`laraarabdev/recordkeeper`](https://github.com/LaraArabDev/recordkeeper) مباشرة — هذه الحزمة هي طبقة عرض Filament فقط فوقها.

### ماذا تتضمّن؟

[](#ماذا-تتضمّن)

المكوّنالوصف**Audit Resource**جدول مُقسّم بعلامات تبويب (الكل، إنشاء، تعديل، حذف، مسارات) مع بحث شامل و8 فلاتر**صفحة العرض**عارض الفروقات قبل/بعد مع تمييز الألوان، ومعاينة التراجع، وطلبات HTTP الصادرة**ودجت الإحصائيات**6 بطاقات إحصائية — إجمالي التدقيقات، إنشاء، تعديل، حذف، طلبات المسارات، المستخدمين الفريدين**ودجت الجدول الزمني**آخر 20 عملية تدقيق في جدول سريع**ودجت أداء الأوامر**رسم بياني ثنائي المحاور لمدة تنفيذ الأوامر وتأثير التدقيق مع كشف الشذوذ**مدير العلاقات**تبويب سجل التدقيق قابل للتضمين في أي ريسورس**HasAuditHistory**سطر واحد لإضافة تبويب سجل التدقيق### المتطلبات

[](#المتطلبات)

المتطلبالإصدارPHP8.2، 8.3، أو 8.4Laravel11 أو 12Filament5.xlaraarabdev/recordkeeper^1.0 (يُثبّت تلقائياً)### التثبيت

[](#التثبيت)

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

حزمة `laraarabdev/recordkeeper` الأساسية تُثبّت تلقائياً — لا حاجة لتثبيتها يدوياً.

### تسجيل الإضافة

[](#تسجيل-الإضافة)

أضف الإضافة في مزوّد لوحة Filament:

```
use LaraArabDev\RecordkeeperFilament\RecordkeeperPlugin;

public function panel(Panel $panel): Panel
{
    return $panel->plugins([
        RecordkeeperPlugin::make()
            ->enableRollback()           // إظهار زر التراجع
            ->enableStatsWidget()        // ودجت الإحصائيات
            ->enableTimeline()           // ودجت الجدول الزمني
            ->enableCommandMetrics()     // ودجت أداء الأوامر
            ->navigationGroup('التدقيق') // تسمية المجموعة في الشريط الجانبي
            ->navigationSort(50)         // ترتيب العرض
            ->navigationIcon('heroicon-o-shield-check'),
    ]);
}
```

### جميع خيارات الإعداد

[](#جميع-خيارات-الإعداد)

الطريقةالافتراضيالوصف`enableRollback(bool)``false`إظهار زر التراجع/الاسترجاع. يتطلب أيضاً `recordkeeper.rollback.enabled = true` في إعدادات الحزمة الأساسية.`enableStatsWidget(bool)``false`تسجيل ودجت الإحصائيات على لوحة التحكم.`enableTimeline(bool)``false`تسجيل ودجت الجدول الزمني على لوحة التحكم.`enableCommandMetrics(bool)``false`تسجيل ودجت أداء الأوامر. تظهر فقط عند تفعيل مقاييس الأوامر في إعدادات الحزمة الأساسية.`navigationGroup(string)``'Audit'`تسمية المجموعة في الشريط الجانبي.`navigationSort(int)``100`ترتيب العرض في الشريط الجانبي.`navigationIcon(string)``'heroicon-o-clock'`أيقونة الريسورس في الشريط الجانبي.`cluster(string)``null`تعيين الريسورس لـ Filament Cluster.`pollingInterval(string)``null`فترة التحديث التلقائي للودجات (مثل `'30s'`).### إضافة سجل التدقيق لأي ريسورس

[](#إضافة-سجل-التدقيق-لأي-ريسورس)

```
use LaraArabDev\RecordkeeperFilament\Concerns\HasAuditHistory;

class OrderResource extends Resource
{
    use HasAuditHistory;
}
```

هذا يُضيف تبويب "History" يعرض جدول التدقيق لكل سجل مع أزرار العرض والتراجع.

### صفحة القائمة — الفلاتر

[](#صفحة-القائمة--الفلاتر)

الفلترالنوعالوصف**الحدث**اختيار متعددتصفية حسب نوع الحدث (يُملأ تلقائياً من البيانات الموجودة)**الموديل**اختيار متعددتصفية حسب نوع الموديل (يعرض اسم الكلاس المختصر)**الحارس (Guard)**اختيار فرديتصفية حسب حارس المصادقة (`web`، `api`، إلخ)**نوع المستخدم**اختيار فرديتصفية حسب نوع المستخدم**رقم المستخدم**حقل نصيتصفية حسب رقم مستخدم محدد**الفترة**نطاق تاريختصفية حسب نطاق التاريخ (من / إلى)**رقم الدُفعة**حقل نصيتصفية حسب معرّف الدُفعة (Batch ID)**قابل للتراجع**ثلاثيإظهار القابل للتراجع فقط / غير القابل / الكلالفلاتر تُحفظ في الجلسة — تبقى حتى عند التنقل أو تحديث الصفحة.

### صفحة العرض — الأقسام

[](#صفحة-العرض--الأقسام)

القسمالمحتوى**نظرة عامة**الحدث، الموضوع، المستخدم، الحارس، عنوان IP، الوقت، رقم الدُفعة**التغييرات**القيم القديمة (قبل) والقيم الجديدة (بعد) جنباً إلى جنب**السياق**بيانات JSON إضافية (معلومات المسار، المدة، مقاييس الأوامر). يظهر فقط عند وجود بيانات.**طلبات HTTP الصادرة**جدول بجميع استدعاءات API الخارجية المرتبطة بهذا التدقيق. يظهر فقط عند تفعيل `recordkeeper.http.enabled`.### التراجع في واجهة المستخدم

[](#التراجع-في-واجهة-المستخدم)

التراجع **معطّل افتراضياً** ويتطلب شرطين:

1. **مستوى الإضافة:** `RecordkeeperPlugin::make()->enableRollback()`
2. **مستوى الحزمة الأساسية:** `config('recordkeeper.rollback.enabled')` يجب أن يكون `true`

عند تفعيل الشرطين، يظهر زر التراجع في ثلاثة أماكن:

المكانالسلوك**إجراء صف في القائمة**تراجع فوري مع حوار تأكيد**إجراء رأس صفحة العرض**تراجع مع نافذة معاينة تعرض التغييرات قبل/بعد**إجراء صف في مدير العلاقات**تراجع فوري مع حوار تأكيدفقط الأحداث القابلة للتراجع تُظهر الزر: `created`، `updated`، `deleted`، `restored`.

الحدث الأصليما يفعله التراجع`created`حذف الموديل نهائياً`updated`استعادة القيم القديمة`deleted`استعادة الموديل (يدعم SoftDeletes)### ترميز الألوان

[](#ترميز-الألوان)

الأحداث مرمّزة بالألوان بشكل موحّد في كامل واجهة المستخدم:

الحدثاللون`created`أخضر (success)`updated`أصفر (warning)`deleted` / `forceDeleted`أحمر (danger)`route.*`أزرق (info)أخرىرمادي (gray)### الودجات بالتفصيل

[](#الودجات-بالتفصيل)

**ودجت الإحصائيات** — 6 بطاقات: إجمالي التدقيقات (أيقونة ساعة)، الإنشاء (دائرة زائد، أخضر)، التعديل (قلم، أصفر)، الحذف (سلة، أحمر)، طلبات المسارات (كرة أرضية، أزرق)، المستخدمين الفريدين (مجموعة مستخدمين). تستخدم استعلام SQL واحد مُحسّن بدلاً من 6 استعلامات منفصلة.

**ودجت الجدول الزمني** — جدول بعرض كامل يعرض آخر 20 عملية تدقيق بدون ترقيم صفحات. يعرض: الوقت (نسبي)، الحدث (شارة ملوّنة)، الموضوع، المستخدم.

**ودجت أداء الأوامر** — رسم بياني شريطي ثنائي المحاور يعرض آخر 14 تنفيذ للأمر المحدد. المحور الأيسر: المدة بالمللي ثانية (أعمدة). المحور الأيمن: عدد التدقيقات المُنشأة (خط). الأعمدة الحمراء تُشير إلى تنفيذ شاذ. قائمة منسدلة لاختيار الأمر (تُملأ تلقائياً).

### البنية المعمارية

[](#البنية-المعمارية)

هذه الحزمة هي **طبقة عرض Filament فقط**. لا تحتوي على أي منطق أعمال — كل شيء يُفوَّض للحزمة الأساسية:

```
┌──────────────────────────────────────────────────┐
│  filament-recordkeeper (هذه الحزمة)                │
│                                                   │
│  RecordkeeperPlugin     → واجهة إعداد الإضافة     │
│  AuditResource          → صفحات القائمة والعرض     │
│  AuditStatsOverview     → ودجت الإحصائيات          │
│  AuditTimeline          → ودجت الجدول الزمني       │
│  CommandMetricsWidget   → ودجت الرسم البياني       │
│  AuditsRelationManager  → تبويب سجل التدقيق       │
│  HasAuditHistory        → Trait سطر واحد           │
│  AuditFormatter         → مساعدات تنسيق مشتركة     │
│  ServiceProvider        → تحميل القوالب فقط        │
└───────────────┬──────────────────────────────────┘
                │ تعتمد على
┌───────────────▼──────────────────────────────────┐
│  recordkeeper (الحزمة الأساسية)                    │
│                                                   │
│  موديل التدقيق، محرك التراجع، حماية الخصوصية،     │
│  PHP 8 Attributes، أوامر Artisan، Middleware،     │
│  محركات التخزين، تتبع Jobs/Commands/Events        │
└──────────────────────────────────────────────────┘

```

### تخصيص القوالب

[](#تخصيص-القوالب)

يمكنك نشر وتخصيص قوالب Blade:

```
php artisan vendor:publish --tag=recordkeeper-filament-views
```

هذا ينسخ القوالب إلى `resources/views/vendor/recordkeeper/`.

### توثيق الحزمة الأساسية

[](#توثيق-الحزمة-الأساسية)

جميع منطق التدقيق موجود في حزمة [`laraarabdev/recordkeeper`](https://github.com/LaraArabDev/recordkeeper). راجع الـ README الخاص بها لمعرفة:

- إعداد الموديلات باستخدام `AuditsChanges` trait
- PHP 8 Attributes (`#[Auditable]`، `#[Redact]`، `#[Encrypt]`، `#[AuditJob]`، `#[AuditCommand]`، `#[AuditEvent]`)
- تدقيق المسارات وAPI عبر Middleware
- التدقيق الشامل للمسارات (`RECORDKEEPER_ROUTES=true`)
- تتبع طلبات HTTP الصادرة (`RECORDKEEPER_HTTP=true`)
- تتبع دورة حياة Jobs وCommands وEvents
- حماية الخصوصية (إخفاء تلقائي + تشفير AES)
- واجهة التراجع والعمليات الجماعية (Batch)
- مُنشئ الاستعلامات (Fluent Query Builder)
- 8 أوامر Artisan
- 4 محركات تخزين (قاعدة بيانات، Redis، سجلات، Null)
- مرجع الإعدادات الكامل

---

للمزيد من التفاصيل والتوثيق الكامل للتدقيق والتراجع والخصوصية، راجع الأقسام الإنجليزية أعلاه أو وثائق [الحزمة الأساسية](https://github.com/LaraArabDev/recordkeeper).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

Total

11

Last Release

50d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61316418?v=4)[Salem Bajubair](/maintainers/salemB88)[@salemB88](https://github.com/salemB88)

---

Top Contributors

[![salemB88](https://avatars.githubusercontent.com/u/61316418?v=4)](https://github.com/salemB88 "salemB88 (9 commits)")

---

Tags

laravelAuditauditingfilamentfilament-pluginactivity-logrollbackrecordkeeper

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/laraarabdev-recordkeeper-filament/health.svg)

```
[![Health](https://phpackages.com/badges/laraarabdev-recordkeeper-filament/health.svg)](https://phpackages.com/packages/laraarabdev-recordkeeper-filament)
```

###  Alternatives

[alizharb/filament-activity-log

A security-first audit control center for Filament v4 and v5 with tenant isolation, risk scoring, integrity checks, retention holds, timelines, and dashboards.

31110.0k4](/packages/alizharb-filament-activity-log)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

278359.3k12](/packages/croustibat-filament-jobs-monitor)[tapp/filament-auditing

Filament Laravel Auditing plugin.

118565.2k3](/packages/tapp-filament-auditing)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

16472.9k](/packages/relaticle-custom-fields)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[backstage/mails

View logged mails and events in a beautiful Filament UI.

16429.7k](/packages/backstage-mails)

PHPackages © 2026

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