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?
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?
Weird that nobody pointed out to Symfony VarDumper, simply do:
\Symfony\Component\VarDumper\VarDumper::dump($data);
I have added a helper da() to Laravel which in fact works as an alias for dd($object->toArray())
Here is the Gist: https://gist.github.com/TommyZG/0505eb331f240a6324b0527bc588769c
as suggested, you can use 'die and dump' such as
dd($var)
or only 'dump', without dying,
dump($var)