title: How to filter json api response by id laravel
body: <p>I am making a call to an endpoint to get back data which returns a lot of it. I need to partition the ones I need grouped into my own category. Basically when I make the call I get this sample response.</p>
  <pre><code>{
      &quot;status&quot;: &quot;success&quot;,
      &quot;message&quot;: &quot;bill categories retrieval successful&quot;,
      &quot;data&quot;: [{
          &quot;id&quot;: 1,
          &quot;biller_code&quot;: &quot;BIL099&quot;,
          &quot;name&quot;: &quot;MTN NIgeria&quot;,
          &quot;default_commission&quot;: 0.03,
          &quot;date_added&quot;: &quot;2018-07-03T00:00:00Z&quot;,
          &quot;country&quot;: &quot;NG&quot;,
          &quot;is_airtime&quot;: true,
          &quot;biller_name&quot;: &quot;AIRTIME&quot;,
          &quot;item_code&quot;: &quot;AT099&quot;,
          &quot;short_name&quot;: &quot;MTN&quot;,
          &quot;fee&quot;: 0,
          &quot;commission_on_fee&quot;: false,
          &quot;label_name&quot;: &quot;Mobile Number&quot;,
          &quot;amount&quot;: 0
      }, {
          &quot;id&quot;: 2,
          &quot;biller_code&quot;: &quot;BIL099&quot;,
          &quot;name&quot;: &quot;GLO Nigeria&quot;,
          &quot;default_commission&quot;: 0.03,
          &quot;date_added&quot;: &quot;2018-07-03T00:00:00Z&quot;,
          &quot;country&quot;: &quot;NG&quot;,
          &quot;is_airtime&quot;: true,
          &quot;biller_name&quot;: &quot;AIRTIME&quot;,
          &quot;item_code&quot;: &quot;AT099&quot;,
          &quot;short_name&quot;: &quot;GLO&quot;,
          &quot;fee&quot;: 0,
          &quot;commission_on_fee&quot;: false,
          &quot;label_name&quot;: &quot;Mobile Number&quot;,
          &quot;amount&quot;: 0
      }, 
  ... //on and on
  }
  
  </code></pre>
  <p>In my code I have this to filter it but it returns empty...</p>
  <pre><code>public function billPower()
  {
      $response = Http::withToken('FLWSECK_******-X')-&gt;get('https://baseUrl/v3/bill-categories', [
  
      ]);
      $collection = collect($response-&gt;json());
      $filtered = $collection-&gt;whereIn('id', [1, 2, 3, 4]);
      return $filtered-&gt;all();
  }
  </code></pre>
  <p>How can I do this in laravel?</p>