PHPackages                             devportolio/laravel-dump-viewer - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. devportolio/laravel-dump-viewer

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

devportolio/laravel-dump-viewer
===============================

A beautiful, modern in-browser debugging tool for Laravel with persistent storage, real-time updates, and an intuitive interface. Inspired by Spatie Ray.

v1.1.0(6mo ago)053↓88.2%MITPHPPHP ^8.2CI passing

Since Dec 29Pushed 6mo agoCompare

[ Source](https://github.com/devportolio/laravel-dump-viewer)[ Packagist](https://packagist.org/packages/devportolio/laravel-dump-viewer)[ Docs](https://github.com/devportolio/laravel-dump-viewer)[ RSS](/packages/devportolio-laravel-dump-viewer/feed)WikiDiscussions main Synced today

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

Laravel Dump Viewer
===================

[](#laravel-dump-viewer)

 [![Laravel Version](https://camo.githubusercontent.com/f002ff4a2256ffcb0be8275519086e42196dae3482e3d466f7f04d7678ab005a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253230253743253230313125323025374325323031322d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://camo.githubusercontent.com/f002ff4a2256ffcb0be8275519086e42196dae3482e3d466f7f04d7678ab005a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253230253743253230313125323025374325323031322d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c) [![PHP Version](https://camo.githubusercontent.com/b62a93fb4f213eea83a8e52bb4c5461696e4a6b91d7452ce2487abfd70659c7b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://camo.githubusercontent.com/b62a93fb4f213eea83a8e52bb4c5461696e4a6b91d7452ce2487abfd70659c7b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870) [![License](https://camo.githubusercontent.com/458425f8985b0b0c8a736cffe75e05a098e3d77906acddbcad2bfc54492a4e02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/458425f8985b0b0c8a736cffe75e05a098e3d77906acddbcad2bfc54492a4e02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)

A beautiful, modern, and powerful in-browser debugging tool for Laravel applications. Inspired by Spatie Ray, but designed as a web-based viewer with persistent storage, real-time updates, and an intuitive interface.

✨ Features
----------

[](#-features)

### 🎯 Core Features

[](#-core-features)

- **🌐 Web-Based Viewer** - View dumps in a beautiful, dedicated web interface
- **💾 Persistent Storage** - Dumps survive page refreshes and stay available across requests
- **🔄 Real-Time Updates** - Auto-refresh to see new dumps as they arrive
- **🏷️ Smart Labeling** - Organize dumps with custom labels and filter by them
- **🎨 Syntax Highlighting** - SQL queries with beautiful formatting
- **🌓 Dark/Light Modes** - Automatically adapts to your preference
- **📱 Responsive Design** - Works perfectly on all screen sizes

### 🚀 Advanced Features

[](#-advanced-features)

- **⚡ Tinker Support** - Works seamlessly in `php artisan tinker`
- **🔍 Smart Detection** - Automatically detects and formats SQL queries
- **📊 Collection Handling** - Beautifully renders Laravel Collections and Models
- **🎯 Multiple Dumps** - Dump multiple values in a single call
- **🔗 Fluent API** - Chain methods like `->label()` and `->stop()`
- **🎨 Unique Colors** - Each label gets a unique, consistent color
- **📈 Performance Mode** - Handles large datasets with smart truncation

📦 Installation
--------------

[](#-installation)

### Requirements

[](#requirements)

- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x

### Install via Composer

[](#install-via-composer)

```
composer require devportolio/laravel-dump-viewer --dev
```

### Publish Configuration (Optional)

[](#publish-configuration-optional)

```
php artisan vendor:publish --tag=dump-viewer-config
```

### Publish Assets (Optional)

[](#publish-assets-optional)

```
php artisan vendor:publish --tag=dump-viewer-assets
```

🎯 Quick Start
-------------

[](#-quick-start)

### Basic Usage

[](#basic-usage)

```
// Simple dump
dumpx($user);

// Dump with label
dumpx($user)->label('User Data');

// Dump multiple values
dumpx($user, $post, $comments);

// Multiple values with label
dumpx($a, $b, $c)->label('Debug Values');

// Label and stop
dumpx($data)->label('Final State')->stop();
```

### View Your Dumps

[](#view-your-dumps)

After calling `dumpx()`, open your browser to:

```
http://your-app.test/dump-viewer

```

📖 Usage Guide
-------------

[](#-usage-guide)

### In Web Requests

[](#in-web-requests)

```
Route::get('/test', function () {
    $user = User::first();

    // Dump the user
    dumpx($user)->label('First User');

    // Continue execution
    return view('test');
});
```

### In Tinker

[](#in-tinker)

```
php artisan tinker

>>> $user = User::first()
>>> dumpx($user)->label('User from Tinker')
>>> dumpx(User::count())->label('Total Users')
```

Then open the viewer in your browser to see the dumps!

### In Artisan Commands

[](#in-artisan-commands)

```
class MyCommand extends Command
{
    public function handle()
    {
        $data = $this->fetchData();

        dumpx($data)->label('Command Data');

        $this->info('Data dumped to viewer!');
    }
}
```

### SQL Query Debugging

[](#sql-query-debugging)

```
$query = DB::table('users')
    ->where('active', true)
    ->toSql();

dumpx($query)->label('User Query');
// Automatically formats with syntax highlighting!
```

### Eloquent Model Debugging

[](#eloquent-model-debugging)

```
$user = User::with('posts', 'comments')->first();

dumpx($user)->label('User with Relations');
// Beautifully renders model attributes and relationships
```

### Collection Debugging

[](#collection-debugging)

```
$users = User::take(100)->get();

dumpx($users)->label('Users Collection');
// Smart rendering with expand/collapse
```

⚙️ Configuration
----------------

[](#️-configuration)

After publishing the config file, you can customize:

```
// config/dump-viewer.php

return [
    // Enable/disable the dump viewer
    'enabled' => env('DUMPX_ENABLED', true),

    // Route to access the viewer
    'route' => env('DUMPX_ROUTE', 'dump-viewer'),

    // Maximum dumps to store
    'storage_limit' => env('DUMPX_STORAGE_LIMIT', 500),

    // Storage driver (file, redis, database, etc.)
    'storage_driver' => env('DUMPX_STORAGE_DRIVER', 'file'),

    // Middleware for the viewer route
    'middleware' => ['web'],
];
```

### Environment Variables

[](#environment-variables)

Add to your `.env` file:

```
# Enable/disable dump viewer
DUMPX_ENABLED=true

# Custom route
DUMPX_ROUTE=dump-viewer

# Storage settings
DUMPX_STORAGE_DRIVER=file
DUMPX_STORAGE_LIMIT=500
```

🎨 Interface Features
--------------------

[](#-interface-features)

### Header Controls

[](#header-controls)

- **🔍 Filter by Label** - Click labels to filter dumps
- **📊 Sort Options** - Sort by time, label, or file
- **⤢ Expand/Collapse All** - Toggle all dumps at once
- **⚡ Auto-Refresh Toggle** - Enable/disable real-time updates
- **🌓 Theme Toggle** - Switch between dark and light modes
- **🗑️ Clear All** - Remove all dumps with one click

### Dump Item Features

[](#dump-item-features)

- **📂 Collapsible Content** - Click to expand/collapse
- **🏷️ Color-Coded Labels** - Each label has a unique color
- **📍 File Location** - Shows file path and line number
- **⏰ Timestamp** - When the dump was created
- **📋 Type Badge** - Shows data type (Array, Model, Collection, etc.)

### Keyboard Shortcuts

[](#keyboard-shortcuts)

- **Scroll to Bottom Button** - In toolbar for quick navigation
- **Floating Scroll to Top** - Appears when scrolled down

🔧 Advanced Usage
----------------

[](#-advanced-usage)

### Custom Labels

[](#custom-labels)

```
// Organize related dumps
dumpx($query)->label('DB Query');
dumpx($result)->label('Query Result');
dumpx($processed)->label('Processed Data');

// Filter by label in the viewer
```

### Multiple Values with Same Label

[](#multiple-values-with-same-label)

```
// All values get the same label
dumpx($var1, $var2, $var3)->label('Test Variables');
```

### Stopping Execution

[](#stopping-execution)

```
// Use ->stop() to dump and halt execution
dumpx($criticalData)->label('Critical Error')->stop();

// Or chain it
dumpx($data)->label('Before Error')->stop();
```

### Performance with Large Datasets

[](#performance-with-large-datasets)

```
// Automatically truncates large collections
$users = User::all(); // 10,000 users

dumpx($users)->label('All Users');
// Shows warning and first 100 items

// Better approach:
dumpx(User::take(50)->get())->label('Sample Users');
```

🎭 Use Cases
-----------

[](#-use-cases)

### 1. API Development

[](#1-api-development)

```
public function store(Request $request)
{
    dumpx($request->all())->label('Request Data');

    $validated = $request->validate([...]);
    dumpx($validated)->label('Validated Data');

    $user = User::create($validated);
    dumpx($user)->label('Created User');

    return response()->json($user);
}
```

### 2. Query Optimization

[](#2-query-optimization)

```
DB::listen(function ($query) {
    dumpx($query->sql)->label('Query: ' . $query->time . 'ms');
});
```

### 3. Event Debugging

[](#3-event-debugging)

```
Event::listen('*', function ($event, $payload) {
    dumpx([
        'event' => $event,
        'payload' => $payload
    ])->label('Event: ' . $event);
});
```

### 4. Job Debugging

[](#4-job-debugging)

```
class ProcessPodcast implements ShouldQueue
{
    public function handle()
    {
        dumpx($this->podcast)->label('Processing Podcast');

        // Process...

        dumpx($result)->label('Process Complete');
    }
}
```

🛡️ Security
-----------

[](#️-security)

### Production Safety

[](#production-safety)

The dump viewer is designed for development only:

```
// Disable in production
'enabled' => env('DUMPX_ENABLED', !app()->isProduction()),

// Or in .env
DUMPX_ENABLED=false
```

### Route Protection

[](#route-protection)

Add authentication middleware:

```
// config/dump-viewer.php
'middleware' => ['web', 'auth', 'admin'],
```

### Access Control

[](#access-control)

Use custom middleware:

```
class DumpViewerAccess
{
    public function handle($request, Closure $next)
    {
        if (!app()->environment('local')) {
            abort(404);
        }

        return $next($request);
    }
}

// config/dump-viewer.php
'middleware' => ['web', DumpViewerAccess::class],
```

🎯 Tips &amp; Best Practices
---------------------------

[](#-tips--best-practices)

### 1. Use Labels Consistently

[](#1-use-labels-consistently)

```
// Good: Organized and filterable
dumpx($query)->label('DB: User Query');
dumpx($result)->label('DB: Query Result');
dumpx($user)->label('User: Loaded');
dumpx($posts)->label('User: Posts');

// Bad: Hard to find and organize
dumpx($query);
dumpx($result);
```

### 2. Clean Up Regularly

[](#2-clean-up-regularly)

```
// In your bootstrap or test setup
if (app()->environment('testing')) {
    app('dumpx')->clear();
}
```

### 3. Use in Tinker Workflows

[](#3-use-in-tinker-workflows)

```
// Keep viewer open in browser
// Run commands in Tinker
// Refresh browser to see dumps
```

### 4. Combine with Logs

[](#4-combine-with-logs)

```
// Dump for immediate visibility
dumpx($data)->label('Debug Point');

// Log for permanent record
Log::debug('Debug point', ['data' => $data]);
```

🔄 Comparison with Alternatives
------------------------------

[](#-comparison-with-alternatives)

FeaturedumpxRayLaravel Debugbardump/dd**Web Interface**✅ Yes❌ Desktop App✅ Yes❌ No**Persistent Storage**✅ Yes✅ Yes❌ Per Request❌ No**Tinker Support**✅ Yes✅ Yes❌ No✅ Yes**Real-time Updates**✅ Yes✅ Yes❌ No❌ No**Labeling**✅ Yes✅ Yes❌ No❌ No**Cost**🆓 Free💰 Paid🆓 Free🆓 Free**Setup**⚡ Easy📱 Desktop⚡ Easy✅ Built-in🐛 Troubleshooting
-----------------

[](#-troubleshooting)

### Dumps Not Showing

[](#dumps-not-showing)

**1. Check if enabled:**

```
php artisan tinker
>>> config('dump-viewer.enabled')
```

**2. Check storage driver:**

```
>>> config('dump-viewer.storage_driver')
// Should be 'file' for Tinker
```

**3. Clear cache:**

```
php artisan cache:clear
php artisan config:clear
```

**4. Check file permissions:**

```
chmod -R 775 storage/framework/cache
```

### Tinker Not Working

[](#tinker-not-working)

**1. Ensure file driver:**

```
DUMPX_STORAGE_DRIVER=file
```

**2. Test cache:**

```
>>> Cache::store('file')->put('test', 'works', 60)
>>> Cache::store('file')->get('test')
```

**3. Manually check dumps:**

```
>>> app('dumpx')->all()
```

### Route Not Found

[](#route-not-found)

**1. Check route name:**

```
>>> config('dump-viewer.route')
```

**2. Clear route cache:**

```
php artisan route:clear
```

**3. List routes:**

```
php artisan route:list | grep dump
```

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License
---------

[](#-license)

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

👏 Credits
---------

[](#-credits)

- Inspired by [Spatie Ray](https://spatie.be/products/ray)
- Built with [Laravel](https://laravel.com)
- Uses [Alpine.js](https://alpinejs.dev) for interactivity
- Styled with [Tailwind CSS](https://tailwindcss.com)

🔗 Links
-------

[](#-links)

- **Author:** Joseph Getaruelas
- **Email:**
- **Package:** devportolio/laravel-dump-viewer

---

Made with ❤️ for the Laravel community

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance68

Regular maintenance activity

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Total

2

Last Release

187d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a574d04091980ab3ba079e5bbdc9e08e5679b26f9897e986aba6dd213b6ec03?d=identicon)[devportolio](/maintainers/devportolio)

---

Top Contributors

[![devportolio](https://avatars.githubusercontent.com/u/31569397?v=4)](https://github.com/devportolio "devportolio (5 commits)")

---

Tags

raylaraveldebugdumpdebugginglaravel-packagedevelopmentdebuggerViewerdumpx

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devportolio-laravel-dump-viewer/health.svg)

```
[![Health](https://phpackages.com/badges/devportolio-laravel-dump-viewer/health.svg)](https://phpackages.com/packages/devportolio-laravel-dump-viewer)
```

###  Alternatives

[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.3k133.0M762](/packages/barryvdh-laravel-debugbar)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.3k2.3M65](/packages/fruitcake-laravel-debugbar)[spatie/laravel-web-tinker

Artisan Tinker in your browser

1.2k4.1M7](/packages/spatie-laravel-web-tinker)

PHPackages © 2026

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