0

I am trying to pull data from external api using guzzle http. Here is my code

$res = $client->request('GET', 'api/endpoint/');
$contents = $res->getBody()->getContents();
return $contents->slots; // THIS LINE GIVES ME ERROR. TRYING TO ACCESS THE SLOT. 

My data structure coming from api looks like this when I just return the $contents like this return $contents

enter image description here

I want to get access of slots.

Anyone can help? Thank you,

Hkm Sadek
  • 2,987
  • 9
  • 43
  • 95

0 Answers0