src/Controllers/ResourceController.php
protected function output($models, array $parameters = [])
    {
        if (ArrayHelper::isIterable($models)) {
            $context = $this->getContext(Action::INDEX, $parameters);
        } else {
            $context = $this->getContext(Action::VIEW, $parameters);
        }

        $output = $this->modelsToResources($models, $context);
        return $this->toResponse($output);
    }
protected function output($models, array $parameters = [])
    {
        if (ArrayHelper::isIterable($models)) {
            $context = $this->getContext(Action::INDEX, $parameters);
        } else {
            $context = $this->getContext(Action::VIEW, $parameters);
        }

        $output = $this->modelsToResources($models, $context);
        return $this->toResponse($output);
    }
Output a resource or a collection of resources
@deprecated Use getModels(), toResource() and toResources()

@param $models
@param array $parameters
@return \Illuminate\Http\JsonResponse