Currently this is my view
{{ $data["id_user"] }}
my controller
$client = new Client;
$request = $client->get('url')->getBody()->getContents();
return view('Admin/lala')->with('data', json_decode($request, true));
get api
{
"code": 200,
"data": [
{
"id_user": 1
}
]
}
I wanted to display it, I've tried it like in here but it's still an error. is there something wrong when I parse the data
As in your json your id_user is inside array data so you have to use foreach in your blade.
Controller:
you can also do it like this:
in your Blade file: