Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Var Dumper Laravel Package

symfony/var-dumper

Symfony VarDumper provides a powerful dump() replacement for var_dump(), letting you inspect complex PHP variables with rich, readable output. Includes advanced casters, configurable formatters, and tooling for debugging in CLI and web contexts.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardized Debugging Infrastructure: Replaces inconsistent var_dump()/dd() usage with a unified, maintainable debugging tool across Laravel applications, reducing technical debt and improving code readability. Aligns with Laravel’s developer experience (DX) priorities by providing rich, interactive output for both CLI and web contexts.
  • Accelerated Development Velocity: Critical for Laravel projects with:
    • Complex Eloquent models (e.g., polymorphic relations, nested queries, or custom accessors).
    • API integrations (debugging GraphQL mutations, REST payloads, or SOAP responses).
    • Queue/Job systems (inspecting payloads, failed jobs, or retry logic).
    • Event-driven architectures (tracing payloads through listeners, observers, or middleware). Reduces debugging time by 60–80% via real-time inspection of variables, exceptions, and system states.
  • Cost-Effective "Build vs. Buy" Decision: Eliminates dependency on third-party tools (e.g., spatie/laravel-debugbar, barryvdh/laravel-debugbar) or custom solutions. Zero licensing costs, no maintenance overhead, and enterprise-grade reliability (backed by Symfony’s 20+ years of development).
  • Future-Proof Laravel Ecosystem:
    • Supports modern PHP features (enums, typed properties, attributes) and Symfony integrations (HTTP clients, processes, messaging).
    • Aligns with Laravel’s roadmap for performance debugging (e.g., profiling queries, caching behavior, or rate-limiting).
    • Enables extensible debugging via casters for custom Eloquent models, Spatie packages, or proprietary data structures.
  • Asynchronous and CLI Workflows: Essential for debugging:
    • Artisan commands (inspecting input/output, environment variables, or configuration).
    • Queue workers (debugging job payloads, exceptions, or retry logic).
    • Scheduled tasks (logging intermediate states without polluting production logs). Provides terminal-optimized, color-coded output with pager support for large datasets.
  • Testing and TDD Optimization:
    • Speeds up iterative development by allowing rapid inspection of test data, mock responses, or assertion failures.
    • Reduces cognitive load during Test-Driven Development (TDD) with structured, collapsible output without cluttering logs.
    • Integrates seamlessly with PestPHP, PHPUnit, or Laravel’s testing tools for debugging test doubles, fixtures, or edge cases.
  • Custom Object and Third-Party Library Support:
    • Extensible via casters to debug proprietary objects, Spatie packages, or complex data structures (e.g., Laravel Nova, Filament, Livewire, or Inertia.js state).
    • Low-effort integration for specialized debugging needs (e.g., debugging Laravel Sanctum tokens, Cashier subscriptions, or Vite asset compilation).
    • Supports Symfony’s HTTP clients (e.g., HttpClient responses) out of the box.

When to Consider This Package

Adopt when:

  • Your Laravel application relies on dump(), dd(), or Tinker for debugging and seeks a more scalable, powerful alternative.
  • Debugging involves complex or deeply nested data, such as:
    • Eloquent relationships (e.g., hasManyThrough, polymorphic relations, or custom accessors).
    • API payloads (GraphQL queries, REST responses, or WebSocket messages).
    • Serialized queue jobs, event payloads, or broadcast messages.
    • Large arrays/objects (e.g., database exports, cached data, or session payloads).
  • You work in non-web environments where terminal output is critical:
    • Artisan commands, CLI scripts, or deployment hooks.
    • Queue workers, scheduled tasks, or cron jobs.
    • CI/CD pipelines (with ANSI/UTF-8 support).
  • Your project integrates Symfony components (e.g., HttpClient, Process, or Messenger) that benefit from VarDumper’s built-in casters.
  • You prioritize developer productivity and want to:
    • Standardize debugging practices across the team (e.g., replace var_dump() with dump()).
    • Reduce onboarding time for new developers with consistent, interactive output.
    • Accelerate feature development with real-time inspection of variables.
  • You need extensibility for custom objects (e.g., adding casters for proprietary models, Spatie packages, or Laravel packages like Laravel Excel or Laravel Medialibrary).
  • Your team uses TDD/BDD and needs rapid inspection of test data, mocks, or assertions without polluting logs or requiring Xdebug.
  • You’re migrating from legacy debugging tools (e.g., laravel-debugbar) and want a lighter, more maintainable solution.

Look elsewhere when:

  • Production debugging: VarDumper is disabled by default in APP_DEBUG=false, but accidental leaks can expose sensitive data. Use:
    • Structured logging (Laravel’s Log facade with filters or monolog handlers).
    • Error monitoring tools (Sentry, Bugsnag, or Laravel Error Pages).
    • Feature flags to gate debug output in staging/production.
  • Performance-critical paths: Dumping large objects (e.g., entire database tables) can cause:
    • Memory exhaustion (mitigate with ->take(100) or sampling).
    • Slow response times (use logging with truncation or circuit breakers).
  • Step-through debugging: VarDumper is not a replacement for:
    • Xdebug or PHPStorm/VSCode debuggers (for breakpoints, watchers, or step execution).
    • Interactive debuggers (e.g., psysh or php -a) for REPL-driven workflows.
  • Legacy PHP versions: Requires PHP 8.1+ (for Symfony 6.4+) or PHP 8.0+ (for Symfony 7.x). For older versions, consider:
    • spatie/laravel-debugbar (PHP 7.3+).
    • Custom var_dump() wrappers with ANSI support.
  • Non-PHP environments: Not applicable for debugging JavaScript, TypeScript, or frontend frameworks (use browser dev tools or console.log).
  • Security-sensitive applications: Avoid dumping request payloads, user data, or API secrets in debug output. Use:
    • Sanitization (e.g., Str::limit() or Arr::except()).
    • Environment-based filtering (e.g., hide sensitive fields in APP_ENV=production).

How to Pitch It (Stakeholders)

For Executives: *"Symfony’s VarDumper is a game-changer for developer productivity in our Laravel applications. It replaces clunky var_dump() calls with a modern, interactive debugging tool that:

  • Cuts debugging time by 60–80% for complex queries, API payloads, and queue jobs.
  • Standardizes debugging across the team, reducing onboarding time and technical debt.
  • Eliminates third-party dependencies, saving on licensing and maintenance costs.
  • Integrates seamlessly with our existing stack (Symfony, PestPHP, Artisan) and future-proofs our codebase. For a one-time integration effort, this delivers measurable gains in velocity—especially for our API, queue, and testing workflows."*

For Engineering Leaders: *"VarDumper gives us enterprise-grade debugging without the bloat of tools like Laravel Debugbar. Key wins:

  • Replace dd()/dump() with a consistent, extensible solution (supports custom casters for our models).
  • CLI-first debugging for Artisan, queues, and CI/CD—no more parsing logs or guessing at var_dump output.
  • TDD/BDD acceleration: Inspect test data, mocks, and assertions without Xdebug overhead.
  • Low risk: MIT-licensed, battle-tested by Symfony, and zero dependency conflicts with Laravel. Let’s pilot it in our API and queue services—the teams that debug the most will see the biggest lift."*

For Developers: *"Say goodbye to var_dump() hell. VarDumper gives you: ✅ Colorized, interactive output (hover to expand arrays/objects, search with Ctrl+F). ✅ CLI-friendly (works in terminals, supports pagers for large data). ✅ Extensible (add casters for your Eloquent models or Spatie packages). ✅ No more guessing: Debug Eloquent relationships, API responses, or queue jobs in seconds. ✅ Works everywhere: Artisan, Tinker, tests, and even Laravel Livewire/Inertia debugging. How to start? Replace dd($var) with

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport