I have successfully fetched two items from an API but when displaying on my view, only one item is showing on my view. What could i be doing wrong in my code below ?
When i echo results, i am able to see that two items are being returned although just one is displayed on the view.
PS: Beginner in Laravel & PHP
Controller
public function fetch()
{
$response = $client->request('/users/99979100/videos', array(), 'GET');
$results = json_decode(json_encode($response),true);
$export_details = $results;
return view('home',compact('export_details'));
}
View
<div class="video-title">
<a href="#">{{$export_details['body']['data'][0]['name']}} - {{$export_details['body']['data'][0]['description']}} </a>
</div>
$export_details