Laravel Dumper - Improve the default output of dump() and dd() in Laravel projects

Last update: May 12, 2022

Laravel Dumper

Improve the default output of dump() and dd() in Laravel projects. Improves the default dump behavior for many core Laravel objects, including:

  • Models
  • Query Builders
  • Service Container
  • Database Connections
  • Carbon Instances
  • Requests and Responses
laravel-dumper.mp4

Installation

Install as a dev dependency:

# composer require glhd/laravel-dumper --dev

Usage

Just use dd() as you would normally, and enjoy the newly curated output!

GitHub

https://github.com/glhd/laravel-dumper
Comments
  • 1. Installation issue PHP < 8.0

    Hello,

    When running composer require, if PHP is below 8.0, it will throw an error during @php artisan package:discover because of typed properties.

    I would recommand upgrading composer.json with the minimum php version or update classes to make it compatible as it should not be a breaking change

    Regards

    Reviewed by akawam at 2022-02-01 08:38
  • 2. Generated SQL statement contains wrong bindings

    Describe the bug When dumping Query Builder, it generates incorrect SQL statement.

    What version does this affect?

    • Laravel Version: 9.0.0
    • Package Version: 1.0.0

    To Reproduce

    dd(User::where('name', 'test')->whereBetween('id', [1, 2]));
    

    It generates following SQL: select * from "users" where "name" = 'test' and "id" between 'test' and 'test'

    Expected behavior

    SQL: select * from "users" where "name" = 'test' and "id" between 1 and 2

    Additional context

    That lost me a few hours, trying to hunt down the bug in my app, then in Eloquent itself, then checking if it is affected by me being on PHP 8.1, etc.

    Reviewed by laacz at 2022-02-09 15:03
  • 3. Make ddf/dumpf more obvious in readme

    I glossed over this a few times in the readme and only realised they were there after source diving and then checking the readme for the helpers I found. This update just makes them a bit more obvious.

    Reviewed by hailwood at 2022-03-07 01:05
  • 4. Add sample of each enhanced dumper vs original output

    This package is pretty awesome! Great work.

    I think it would help the uptake if we could add some way to show the improvement of each dumper. Ideas are

    • Videos like on the readme
    • Screenshots of the top parts
    • Directory of e.g. query_builder_original.txt and query_builder_enhanced.txt
    Reviewed by hailwood at 2022-01-20 22:20
  • 5. Add diffs

    This addresses #2 by adding sample diffs that are auto-generated from the test cases. It also updates test case names to improve the diff file output.

    Reviewed by inxilpro at 2022-01-21 15:10
  • 6. Allow usage of Lumen in Caster.php

    Remove type hint for Illuminate\Contracts\Foundation\Application and also allowed \Laravel\Lumen\Application. Error handling could be implemented, but is not necessary in my opinion

    To use it in Lumen in bootstrap/app.php the following line should be added:

    $app->register(\Glhd\LaravelDumper\LaravelDumperServiceProvider::class);

    Fixes #9

    Reviewed by Cyb0rk at 2022-03-12 19:42
The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function that you can use instead of var_dump().

VarDumper Component The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function t

May 18, 2022
This package connects a Laravel Octance application with Tideways for PHP Monitoring, Profiling and Exception Tracking.

Tideways Middleware for Laravel Octane This package connects a Laravel Octance application with Tideways for PHP Monitoring, Profiling and Exception T

Jan 6, 2022
Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app.
Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app.

A server for debugging more than just Laravel applications. Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps d

May 16, 2022
Xdebug — Step Debugger and Debugging Aid for PHP

Xdebug Xdebug is a debugging tool for PHP. It provides step-debugging and a whole range of development aids, such as stack traces, a code profiler, fe

May 13, 2022
Kint - a powerful and modern PHP debugging tool.
Kint - a powerful and modern PHP debugging tool.

Kint - debugging helper for PHP developers What am I looking at? At first glance Kint is just a pretty replacement for var_dump(), print_r() and debug

May 14, 2022
A collection of helper methods for testing and debugging API endpoints.

Laravel API Test Helpers This is a collection of helper methods for testing and debugging API endpoints. Installation You can install the package via

Apr 16, 2022
The ultimate debugging and development tool for ProcessWire
The ultimate debugging and development tool for ProcessWire

Tracy Debugger for ProcessWire The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS Integrates and extends Nette

Apr 14, 2022
Generate Laravel test factories from your existing models

Laravel Test Factory Generator php artisan generate:model-factory This package will generate factories from your existing models so you can get starte

May 15, 2022
Laravel Debugbar (Integrates PHP Debug Bar)
Laravel Debugbar (Integrates PHP Debug Bar)

Laravel Debugbar This is a package to integrate PHP Debug Bar with Laravel. It includes a ServiceProvider to register the debugbar and attach it to th

May 24, 2022
A beautiful error page for Laravel apps
A beautiful error page for Laravel apps

Ignition: a beautiful error page for Laravel apps Ignition is a beautiful and customizable error page for Laravel applications running on Laravel 5.5

May 13, 2022
:dromedary_camel: Laravel log viewer
:dromedary_camel: Laravel log viewer

Laravel log viewer TL;DR Log Viewer for Laravel 5, 6, 7 & 8 (still compatible with 4.2 too) and Lumen. Install with composer, create a route to LogVie

May 24, 2022
:page_with_curl: Provides a log viewer for Laravel
:page_with_curl: Provides a log viewer for Laravel

LogViewer By ARCANEDEV© This package allows you to manage and keep track of each one of your log files. NOTE: You can also use LogViewer as an API. Of

May 26, 2022
A Laravel Package to integrate Nette Tracy Debugger
A Laravel Package to integrate Nette Tracy Debugger

Nette Tracy for Laravel 5 Better Laravel Exception Handler Features Visualization of errors and exceptions Debugger Bar (ajax support @v1.5.6) Excepti

May 3, 2022
An elegant debug assistant for the Laravel framework.
An elegant debug assistant for the Laravel framework.

Introduction Laravel Telescope is an elegant debug assistant for the Laravel framework. Telescope provides insight into the requests coming into your

May 19, 2022
Ray server is a beautiful, lightweight php app build on Laravel that helps you debug your app. It runs without installation on multiple platforms.
Ray server is a beautiful, lightweight php app build on Laravel that helps you debug your app. It runs without installation on multiple platforms.

RayServer is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app. It runs without installation on multiple platforms.

May 16, 2022
A Magento 2 module that adds a CLI bin/magento cms:dump to dump all CMS pages and CMS blocks to a folder var/cms-output.

A Magento 2 module that adds a CLI bin/magento cms:dump to dump all CMS pages and CMS blocks to a folder var/cms-output.

Mar 9, 2022
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Jan 19, 2022
Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel
Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel

Improve default Magento 2 Import / Export features - cron jobs, CSV , XML , JSON , Excel , mapping of any format, Google Sheet, data and price modification, improved speed and a lot more!

Mar 28, 2022
PHP 5.3+ Extensible Dumper
PHP 5.3+ Extensible Dumper

Ladybug: PHP 5.3+ Extensible Dumper Ladybug provides an easy and extensible var_dump / print_r replacement for PHP 5.3+ projects. Any PHP variable, ob

May 6, 2022
A Laravel package to output a specific sql to your favourite debugging tool. The supported log output is Laravel Telescope, Laravel Log, Ray, Clockwork, Laravel Debugbar and your browser.
A Laravel package to output a specific sql to your favourite debugging tool. The supported log output is Laravel Telescope, Laravel Log, Ray, Clockwork, Laravel Debugbar and your browser.

Laravel showsql A Laravel package to output a specific sql to your favourite debugging tool, your browser or your log file. Use case You often want to

Apr 15, 2022