code: public function getFiles(int $id)
      {
          if(!$object = $this->repository->find($id)) {
              abort(404);
          }
  
          $media = $object->getMedia();
  
          return MediaResource::collection($media);
      }
docs: Get all Files
  
  @param int $id
  @return AnonymousResourceCollection|MediaResource[]