title: Retrieving all number row from JSON response
body: <p>Using Guzzle I am hooking into an API. The API will provide me with a valid JSON object that contains values I require. I have tried several methods to retrieve an array of values located within the response but at this point can only get one per request via the number of the row:</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>public function index () {
      //$value = "07332927917462,07332927917455";
      $client = new Client();
      $response = $client-&gt;get('https://example.com/xxx', 
                               [ 'query' =&gt; [
                               'secret' =&gt; '2acbefghijklmnop',
                               'created' =&gt; '2016-01-01']]);
  
      $data = json_decode($response-&gt;getBody()-&gt;getContents());
      $array = $data-&gt;products;
      $collect = collect($array);
      $unique = $collect-&gt;unique('ean');
      $unique-&gt;values()-&gt;all();
  
  
      return dd($unique[0]-&gt;ean);
    }
  </code></pre>
  
  <p>In my <code>return dd($unique[0]-&gt;ean);</code> I am receiving only one EAN value (via the number), so it will look like this;</p>
  
  <pre><code>"012345678910"
  </code></pre>
  
  <p>When I try to call it using <code>return dd($unique-&gt;ean);</code> I receive an error:</p>
  
  <p><a href="http://i.stack.imgur.com/nzPRs.png" rel="nofollow">Laravel response</a></p>
  
  <p>Bascially, what I need to do is get all the rows, not just one. so the request would be something like (for example purposes) <code>return dd($unique[all]-&gt;ean);</code> but I am not sure how to approach this?</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Here is my response using just <code>dd($unique);</code>:</p>
  
  <p><a href="http://i.stack.imgur.com/nu91W.png" rel="nofollow">json</a></p>