src/Controllers/ResourceController.php
protected function modelsToResources($models, Context $context, $resourceDefinition = null)
    {
        if (ArrayHelper::isIterable($models)) {
            return $this->toResources($models, $context, $resourceDefinition);
        } elseif ($models instanceof Model) {
            return $this->toResource($models, $context, $resourceDefinition);
        } else {
            return $models;
        }
    }
protected function modelsToResources($models, Context $context, $resourceDefinition = null)
    {
        if (ArrayHelper::isIterable($models)) {
            return $this->toResources($models, $context, $resourceDefinition);
        } elseif ($models instanceof Model) {
            return $this->toResource($models, $context, $resourceDefinition);
        } else {
            return $models;
        }
    }
Take one or multiple models and transform them into one or multiple resources.
Notice: When non-model content is found, it is returned "as-is".
@deprecated Use toResources() or toResource().
@param Model|Model[] $models
@param Context $context
@param null $resourceDefinition
@return RESTResource|RESTResource[]|mixed