How to display a readable array - Laravel

Viewed 125452

After I write:

Route::get('/', function()
{
    dd(User::all());
});

And after I refresh the browser I get an unreadable array. Is there a way to get that array in a readable format?

9 Answers

Weird that nobody pointed out to Symfony VarDumper, simply do:

\Symfony\Component\VarDumper\VarDumper::dump($data);

as suggested, you can use 'die and dump' such as

dd($var)

or only 'dump', without dying,

dump($var)

Related