Laravel Introduces A New Debug Global ddd() Helper

Ammar M
1 min readOct 8, 2019

--

Laravel Ignition(Ignition is the new error page for Laravel) introduces a global ddd() helper available in all Laravel 6 installations and applications that have Ignition 1.9+ installed.

We all love to debug our code using dd - it's fast and easy. But sometimes we want to have some more information available. Or we forgot to dump some things about our request, so we have to edit our dd and do it all over again.

ddd - a globally available helper function that does everything that we love about dd and sprinkles everything that Ignition has to offer on top of it.

Let’s say we want to dump a string and a user model somewhere in the code. With ddd we can do this, just as we would with dd:

$user = User::first();ddd('dumping my article', $user); 

After executing the code, this is what we will see:

The ddd helper will dump the data, show Ignition and exit. This gives you the power of dd combined with all the great features of Ignition.

Additionally, it also gives access to the stack trace means we can easily trace where we used ddd() helper, the request, and all the typical tabs offered on an Ignition page.

--

--

Ammar M

Senior Software Engineer #techJunkie #programmingEnthusiast #Learner