src/NilPortugues/Laravel5/JsonApi/Controller/JsonApiController.php
public function index()
    {
        $apiRequest = RequestFactory::create();

        $page = $apiRequest->getPage();
        if (!$page->size()) {
            $page->setSize($this->pageSize);
        }

        $fields = $apiRequest->getFields();
        $sorting = $apiRequest->getSort();
        $included = $apiRequest->getIncludedRelationships();
        $filters = $apiRequest->getFilters();

        $resource = new ListResource($this->serializer, $page, $fields, $sorting, $included, $filters);

        $totalAmount = $this->totalAmountResourceCallable();
        $results = $this->listResourceCallable();

        $controllerAction = '\\'.get_called_class().'@index';
        $uri = $this->uriGenerator($controllerAction);

        return $this->addHeaders($resource->get($totalAmount, $results, $uri, get_class($this->getDataModel())));
    }
public function index()
    {
        $apiRequest = RequestFactory::create();

        $page = $apiRequest->getPage();
        if (!$page->size()) {
            $page->setSize($this->pageSize);
        }

        $fields = $apiRequest->getFields();
        $sorting = $apiRequest->getSort();
        $included = $apiRequest->getIncludedRelationships();
        $filters = $apiRequest->getFilters();

        $resource = new ListResource($this->serializer, $page, $fields, $sorting, $included, $filters);

        $totalAmount = $this->totalAmountResourceCallable();
        $results = $this->listResourceCallable();

        $controllerAction = '\\'.get_called_class().'@index';
        $uri = $this->uriGenerator($controllerAction);

        return $this->addHeaders($resource->get($totalAmount, $results, $uri, get_class($this->getDataModel())));
    }
public function index ( ) { $ apiRequest = RequestFactory :: create ( ) ; $ page = $ apiRequest -> getPage ( ) ; if ( ! $ page -> size ( ) ) { $ page -> setSize ( $ this -> pageSize ) ; } $ fields = $ apiRequest -> getFields ( ) ; $ sorting = $ apiRequest -> getSort ( ) ; $ included = $ apiRequest -> getIncludedRelationships ( ) ; $ filters = $ apiRequest -> getFilters ( ) ; $ resource = new ListResource ( $ this -> serializer , $ page , $ fields , $ sorting , $ included , $ filters ) ; $ totalAmount = $ this -> totalAmountResourceCallable ( ) ; $ results = $ this -> listResourceCallable ( ) ; $ controllerAction = '\\' . get_called_class ( ) . '@index' ; $ uri = $ this -> uriGenerator ( $ controllerAction ) ; return $ this -> addHeaders ( $ resource -> get ( $ totalAmount , $ results , $ uri , get_class ( $ this -> getDataModel ( ) ) ) ) ; }
Get many resources.

@return \Symfony\Component\HttpFoundation\Response
Get many resources .