how to dd with a header set to json?

Published 2 weeks ago by tjnapster555

i am outputting a json but every time it die dump (dd) to a string but i want to see it raw i can copy and paste it online to parse and check but its very long , is there any i can set the header with dd like this

dd('header'=>'content-json',$jsonVar);
danmatthews

Why not dd(json_decode($jsonVar)); ?

It'll turn it into an array/object that you can then click through using the toggle arrows that the dump functions provide.

Cronix
Cronix
2 weeks ago (133,750 XP)

just

return response()->json(yourStuff);
tjnapster555

i want to to debug

Cronix
Cronix
2 weeks ago (133,750 XP)

Did you try it? It will dump the json to the screen sending appropriate json headers

Sign In or create a forum account to participate in this discussion.