On the Tighten.co blog they have a recent post sharing a better dd() for your TDD - basically a better method for debugging the current state of object with a "dump and die" function.
An important part of every Laravel developer's debugging arsenal is the humble dd() helper function—"dump and die"—to output the contents of a variable and terminate execution of your code. In the browser, dd() results in a structured, easy-to-read tree, complete with little arrow buttons that can be clicked to expand or hide children of nested structures. In the terminal, however, it's a different story.
[...] Fortunately, it's simple to build your very own customized version of dd() to help tame your unwieldy terminal output—helping you find the details you're interested in quickly, without wearing out your trackpad (and your patience).
He provides two options you can use to help clean up the output of a "dump or die" method from the extensive results the current "dd" function provides:
- Option 1: Using Symfony's VarDumper (with custom configuration options)
- Option 2: Kint
Kint provides a few other helper methods you can use and easily configurable max and min depth to show in the output.