true "data" => array:2 [▼ "d" => 5 "ss" => "3.0" ] ] +...">

How to trigger a response in laravel

Response {#695 ▼
  +original: array:2 [▼
    "success" => true
    "data" => array:2 [▼
      "d" => 5
      "ss" => "3.0"
    ]
  ]
  +exception: null
  +headers: ResponseHeaderBag {#691 ▶}
  #content: "{"success":true,"data":{"d":5,"ss":"3.0"}}"
  #version: "1.0"
  #statusCode: 200
  #statusText: "OK"
  #charset: null
}

How do I access the value ss echo $rating_data['data']['ss'];die;

he says You cannot use an object of type Illuminate\Http\Response as arrayplease suggest

+4
source share
1 answer

you can use dd () to print the result in a readable formate:

dd(json_decode(json_encode($ResponseData), true));

and return reply:

return response()->json($ResponseData);

Hope this helps you!

+1
source

Source: https://habr.com/ru/post/1680499/


All Articles