code: public function multipleToAPIResponseData(?array $resources): APIResponseData
      {
          if(is_null($resources)) {
              return $this->toAPIResponseData(null);
          }
  
          return new APIResponseData(array_map(function(Resource $resource) {
              return $this->toAPIResponseData($resource)->getData();
          }, $resources));
      }
docs: Uses above method for each resource, extracting the data into an array, creating a new APIResponseData from that array.
  @param null|Resource[] $resources
  @return APIResponseData
  @throws UnableToCreateAPIResponseDataException