PHPackages                             anil/dump - 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. anil/dump

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

anil/dump
=========

A Laravel dump server package for intercepting and displaying dump output.

v0.1.2(1mo ago)111↓100%MITPHPPHP ^8.2CI passing

Since May 7Pushed 1w agoCompare

[ Source](https://github.com/anilkumarthakur60/dump)[ Packagist](https://packagist.org/packages/anil/dump)[ RSS](/packages/anil-dump/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (12)Versions (5)Used By (0)

Laravel Dump Server
===================

[](#laravel-dump-server)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a62c4d46df6a677d0e398507a077bf813896c5ce03cee3f07be15bbeb2931c35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e696c2f64756d702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anil/dump)[![Total Downloads](https://camo.githubusercontent.com/f7393929a4a4bf65a30ff54e3908307609483c068ae902458ad8eb54638b7c75/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e696c2f64756d702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anil/dump)[![Tests](https://github.com/anilkumarthakur60/dump/actions/workflows/tests.yml/badge.svg)](https://github.com/anilkumarthakur60/dump/actions/workflows/tests.yml)[![License](https://camo.githubusercontent.com/d8b02e26bc0e4a6bbf5ae44edca312ec3be57b4912407bfce8afd86886f2ad50/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616e696c2f64756d702e7376673f7374796c653d666c61742d737175617265)](LICENSE)

A Laravel package that intercepts `dump()` and `dd()` calls and streams them to a dedicated terminal server — keeping your browser responses clean while you debug.

Inspired by Symfony's `var-dump-server`, built for the Laravel ecosystem.

---

Features
--------

[](#features)

- Intercepts all `dump()` / `dd()` calls and forwards them to a running terminal server
- Falls back to CLI or HTML output when the server is not running
- Attaches request context (URI, method, controller) and a stack trace to every dump
- Optional log channel support — write every dump to a Laravel log channel
- Global helpers: `dump_if()`, `dump_unless()`, `dd_if()`, `dd_unless()`
- `DumpFake` testing utility with rich PHPUnit assertions
- Production guard — the handler is never registered when `APP_ENV=production`
- Configurable clone depth and item limits via environment variables

---

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

[](#requirements)

DependencyVersionPHP^8.2Laravel^11.0 | ^12.0 | ^13.0symfony/var-dumper^7.0 | ^8.0---

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

[](#installation)

Install as a **dev dependency** (recommended — debug tooling should not ship to production):

```
composer require anil/dump --dev
```

If you need the dump server available in production (e.g. for staging environments or log-channel mirroring), install it as a regular dependency instead:

```
composer require anil/dump
```

The service provider is auto-discovered. Then run the install command to publish the config and add the required environment variables:

```
php artisan dump:install
```

This will:

- Publish `config/dump-server.php`
- Append `DUMP_SERVER_HOST`, `DUMP_SERVER_ENABLED`, and `DUMP_SERVER_LOG_ENABLED` to both `.env` and `.env.example`

---

Usage
-----

[](#usage)

### 1. Start the dump server

[](#1-start-the-dump-server)

In a separate terminal, start the server before making requests:

```
php artisan dump:server
```

Output HTML instead of CLI output:

```
php artisan dump:server --format=html
```

### 2. Call `dump()` or `dd()` as usual

[](#2-call-dump-or-dd-as-usual)

```
dump($user);
dump(['key' => 'value']);
dd($request->all());
```

When the server is running, output is captured and displayed in the server terminal — with request context and a stack trace — instead of inline in the browser.

When the server is **not** running, `dump()` falls back to normal CLI or HTML output.

---

Helper Functions
----------------

[](#helper-functions)

Four conditional helpers are available globally:

```
// Dump only when the condition is true
dump_if($user->isAdmin(), $user);

// Dump only when the condition is false
dump_unless($request->isJson(), $request->all());

// Die-and-dump only when the condition is true
dd_if(app()->isLocal(), $response);

// Die-and-dump only when the condition is false
dd_unless($feature->isEnabled(), $payload);
```

---

Configuration
-------------

[](#configuration)

Publish the config file manually if needed:

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

`config/dump-server.php`:

```
return [
    // TCP host the server listens on
    'host' => env('DUMP_SERVER_HOST', 'tcp://127.0.0.1:9912'),

    // Set to false to disable the handler entirely in an environment
    'enabled' => env('DUMP_SERVER_ENABLED', true),

    // VarCloner limits — increase for deeply nested structures
    'max_depth' => env('DUMP_SERVER_MAX_DEPTH', 10),
    'max_items' => env('DUMP_SERVER_MAX_ITEMS', 2500),

    // Optionally mirror every dump to a log channel
    'log' => [
        'enabled' => env('DUMP_SERVER_LOG_ENABLED', false),
        'channel' => env('DUMP_SERVER_LOG_CHANNEL', 'stack'),
        'level'   => env('DUMP_SERVER_LOG_LEVEL', 'debug'),
    ],
];
```

### Environment variables

[](#environment-variables)

VariableDefaultDescription`DUMP_SERVER_HOST``tcp://127.0.0.1:9912`TCP address the server binds to`DUMP_SERVER_ENABLED``true`Set to `false` to disable the handler`DUMP_SERVER_MAX_DEPTH``10`Maximum clone depth for nested objects`DUMP_SERVER_MAX_ITEMS``2500`Maximum number of items cloned`DUMP_SERVER_LOG_ENABLED``false`Mirror dumps to a log channel`DUMP_SERVER_LOG_CHANNEL``stack`Log channel to write to`DUMP_SERVER_LOG_LEVEL``debug`PSR-3 log level---

Testing
-------

[](#testing)

The package ships with `DumpFake`, a drop-in test helper that captures dumps and provides PHPUnit assertions.

```
use Anil\Dump\Testing\DumpFake;

$fake = DumpFake::fake();

dump('hello');
dump(42);
dump(['a' => 1]);

// Assert a specific value was dumped
$fake->assertDumped('hello');

// Assert a value was NOT dumped
$fake->assertNotDumped('world');

// Assert nothing was dumped
$fake->assertNothingDumped();

// Assert the total number of dumps
$fake->assertDumpedCount(3);

// Assert using a custom callback
$fake->assertDumpedUsing(fn ($v) => is_array($v) && isset($v['a']));

// Retrieve all captured values
$dumped = $fake->getDumped();

// Restore the original handler when done
$fake->restore();
```

### Running the test suite

[](#running-the-test-suite)

```
composer test
```

---

Static Analysis
---------------

[](#static-analysis)

The package is analysed at PHPStan level 10 with Larastan:

```
composer analyse
```

---

Code Style
----------

[](#code-style)

Formatting is enforced with Laravel Pint:

```
composer format       # fix
composer format:check # check only
```

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for release history.

---

License
-------

[](#license)

The MIT License (MIT). See [LICENSE](LICENSE) for details.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance96

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 83.9% 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

3

Last Release

33d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16583802?v=4)[Er. Anil Kumar Thakur](/maintainers/anilkumarthakur60)[@anilkumarthakur60](https://github.com/anilkumarthakur60)

---

Top Contributors

[![anilkumarthakur60](https://avatars.githubusercontent.com/u/16583802?v=4)](https://github.com/anilkumarthakur60 "anilkumarthakur60 (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")

---

Tags

laraveldebugdumpvar-dumperdump-server

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/anil-dump/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k28.4M134](/packages/laravel-cashier)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M120](/packages/laravel-pulse)

PHPackages © 2026

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