ResourceCollection.php 380 B

12345678910111213141516
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
  4. class ResourceCollection extends AnonymousResourceCollection
  5. {
  6. public function withResponse($request, $response)
  7. {
  8. $data = $response->getData(true);
  9. unset($data['links']);
  10. unset($data['meta']['path']);
  11. $response->setData($data);
  12. }
  13. }