how to dd with a header set to json?

Published 4 months 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
4 months ago (175,190 XP)

just

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

i want to to debug

Cronix
Cronix
4 months ago (175,190 XP)

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

Please sign in or create an account to participate in this conversation.