How can I show JSON response in foreach loop:
$client = new Client();
$res = $client->get('https://api.exchangerate.host/symbols');
$data['symbols'] = $res->getBody();
return view('welcome', $data);
When I tried to show using loop then showing nothing Here is my loop
@foreach ($symbols as $symbol)
<a href="" onclick="myfunction()">{{ $symbol }}</a>
@endforeach
And here is the response code
{
"motd": {
"msg": "If you or your company use this project or like what we doing, please consider backing us so we can continue maintaining and evolving this project.",
"url": "https://exchangerate.host/#/donate"
},
"success": true,
"symbols": {
"AED": {
"description": "United Arab Emirates Dirham",
"code": "AED"
},
"AFN": {
"description": "Afghan Afghani",
"code": "AFN"
}
}
}
I want to show just symbols in the loop!