title: Trying to get property name and id of laravel payload
body: <p>I have  this JSON payload below and want to get names and ids from the payload. However, l cannot object names and ids from  the payload.</p>
  <p>Decode JSON</p>
  <pre><code> $result = json_decode($resp-&gt;getBody()-&gt;getContents(), true);
                  return response()-&gt;json(
                      [
      
                          &quot;code&quot; =&gt; 200,
                          &quot;message&quot; =&gt; &quot;OK&quot;,
                          &quot;payload&quot;=&gt;  $result['payload'] ?? '',
                      ]);
  </code></pre>
  <p>Api json payloads</p>
  <pre><code>{
      &quot;code&quot;: 200,
      &quot;message&quot;: &quot;OK&quot;,
      &quot;payload&quot;: {
          &quot;items&quot;: [
              {
                  &quot;name&quot;: &quot;Hostel&quot;,
                  &quot;image&quot;: {
                      &quot;name&quot;: &quot;WEWEBBFC791FD50E347BD.jpeg&quot;
                  },
                  &quot;rate&quot;: {
                      &quot;amount&quot;: &quot;3.0000&quot;,
                      &quot;currency&quot;: {
                          &quot;code&quot;: &quot;US&quot;
                      }
                  },
                  &quot;pricing&quot;: [
                      {
                          &quot;rate&quot;: &quot;3.0000&quot;
                      }
                  ],
                  &quot;id&quot;: 12, // get this id
                  &quot;created_at&quot;: &quot;2021-02-28T11:08:25+00:00&quot;
              }
              ..........
          ],
          &quot;total&quot;: 10,
          &quot;offset&quot;: 10
      }
  }
  </code></pre>