PHPackages                             skycoder/laravel-phantom - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. skycoder/laravel-phantom

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

skycoder/laravel-phantom
========================

Zero-config database activity tracking, timeline &amp; automation for Laravel.

v1.0.0(1mo ago)03MITPHP ^7.2|^8.0|^8.1|^8.2|^8.3|^8.4

Since Jul 6Compare

[ Source](https://github.com/skycoder026/laravel-phantom)[ Packagist](https://packagist.org/packages/skycoder/laravel-phantom)[ RSS](/packages/skycoder-laravel-phantom/feed)WikiDiscussions Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Laravel Phantom 👻
=================

[](#laravel-phantom-)

Zero-config database activity tracking, timeline &amp; automation for Laravel.

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

[](#installation)

```
composer require skycoder/laravel-phantom
```

That's it. No configuration. No traits. No setup. Phantom hooks into `DB::listen()` on boot and starts tracking every INSERT/UPDATE/DELETE across your whole database.

Dashboard
---------

[](#dashboard)

Visit `yourdomain.com/phantom` to see the activity dashboard.

- **Tracked Tables** — every table Phantom has logged activity for, with entry counts
- **Browse all tables** — every table in the database (searchable/sortable), even ones with no activity yet
- **Per-table live data** — the actual current rows in a table, paginated and searchable
- **Per-record timeline** — full history for one row: created → updated (field-by-field, old → new) → deleted, grouped by day, infinite-scroll

⚠️ Security
-----------

[](#️-security)

None of the `/phantom` routes ship with authentication. Anyone who can reach that URL can browse the **live contents of every table in your database** (only `password`/`remember_token` columns are masked). Before deploying to anything but local development, protect the routes yourself, e.g. in your app's `RouteServiceProvider` or a wrapping route group:

```
Route::middleware(['web', 'auth', 'can:view-phantom'])
    ->group(base_path('vendor/skycoder/laravel-phantom/routes/phantom.php'));
```

or gate the whole thing behind your admin panel's existing middleware stack. This is on the roadmap to make config-driven; for now it's the integrator's responsibility.

Features
--------

[](#features)

- ✅ Tracks ALL database operations (Eloquent, Query Builder, Raw)
- ✅ INSERT / UPDATE / DELETE detection
- ✅ Field-level change tracking (old vs new values on UPDATE)
- ✅ Per-table timeline &amp; per-record history, grouped by day with infinite scroll
- ✅ Who, when, what — full audit trail (resolves `user_id` to a name from your `users` table when possible)
- ✅ Browse every table's live data with search/sort/pagination, drill into any row's timeline
- ✅ Beautiful built-in dashboard with light/dark theme (follows system, toggleable, persisted)
- ✅ No-op updates aren't logged — an UPDATE that doesn't change any tracked field never hits `phantom_logs`
- ✅ Sensitive fields (`password`, `remember_token`) never stored in the audit trail
- ✅ File/upload fields (name matches `file`, `image`, `photo`, `avatar`, `attachment`, `document`, `upload`, `thumbnail`, `banner`, `logo`, `video`, `audio`, `media`) never stored
- 🔜 Email &amp; notification automation
- 🔜 Conditional triggers
- 🔜 Config-driven route protection

How it works
------------

[](#how-it-works)

Phantom listens to every query via `DB::listen()` and keeps two tables:

- **`phantom_logs`** — one row per INSERT/UPDATE/DELETE: table, record id, operation, who/when, and (for updates) `modified_data` — only the fields that actually changed, as `{"field": {"old": ..., "new": ...}}`.
- **`phantom_snapshots`** — the last known full state of each record (excluding `id`, `created_at`, `updated_at`, `password`, `remember_token`, and file/upload-looking fields), used to diff against on the next update.

Tables `phantom_logs`, `phantom_snapshots`, `sessions`, `cache`, `migrations`, `record_timelines`, and `timelines` are always ignored.

Programmatic use
----------------

[](#programmatic-use)

The `Phantom` facade (bound to the same instance used internally) exposes:

```
use Skycoder\Phantom\Facades\Phantom;

Phantom::phantomTimelineUrl('orders', 42);
// -> https://yourdomain.com/phantom/table/orders/records/42
```

Requirements
------------

[](#requirements)

- PHP 7.2+ or 8.0+
- Laravel 5.8, 6.x, 7.x, 8.x, 9.x, 10.x, 11.x, 12.x, or 13.x

Compatibility
-------------

[](#compatibility)

LaravelPHP5.8.x7.2+6.x7.2+7.x7.2.5+8.x7.3+9.x8.0+10.x8.1+11.x8.2+12.x8.2+13.x8.3+License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6e271f2abaa23761d1c32502de935a92b288438e7f76e45a1bc240ebef34660?d=identicon)[skycoder026](/maintainers/skycoder026)

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/skycoder-laravel-phantom/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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