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 unwieldly terminal output.
Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!