lib/Http/Controllers/Base/IndexActions/GetIndexTrait.php
public function get(Request $request, Fractal $fractal, FractalCollection $collection)
    {
        $this->beforeRequest($request, func_get_args());
        $transformer = $this->getTransformer();
        $includes = $request->input('include', '');
        $filter = $request->input('filter', false);
        $items = $this->getRepository();
        if ($filter && is_string($filter)) {
            $filter = json_decode($filter, true);
        }
        $queryFilter = [];
        if (!empty($filter)) {
            $queryFilter = new QueryFilter($filter, $items->model(), $this->getTransformer()); 
        }
        $fractal->parseIncludes($includes);
        $resource = $collection->setTransformer($transformer)->setResourceKey($this->getResourceKey());
        $paginator = $items->paginate($queryFilter, $transformer->getSafeEagerLoad($fractal->getRequestedIncludes()), app('context'));
        $itemCollection = $paginator->getCollection();
        $resource->setData($itemCollection);
        $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
        return $this->respondWithCollection($fractal->createData($resource));
    }
public function get(Request $request, Fractal $fractal, FractalCollection $collection)
    {
        $this->beforeRequest($request, func_get_args());
        $transformer = $this->getTransformer();
        $includes = $request->input('include', '');
        $filter = $request->input('filter', false);
        $items = $this->getRepository();
        if ($filter && is_string($filter)) {
            $filter = json_decode($filter, true);
        }
        $queryFilter = [];
        if (!empty($filter)) {
            $queryFilter = new QueryFilter($filter, $items->model(), $this->getTransformer()); 
        }
        $fractal->parseIncludes($includes);
        $resource = $collection->setTransformer($transformer)->setResourceKey($this->getResourceKey());
        $paginator = $items->paginate($queryFilter, $transformer->getSafeEagerLoad($fractal->getRequestedIncludes()), app('context'));
        $itemCollection = $paginator->getCollection();
        $resource->setData($itemCollection);
        $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
        return $this->respondWithCollection($fractal->createData($resource));
    }
public function get ( Request $ request , Fractal $ fractal , FractalCollection $ collection ) { $ this -> beforeRequest ( $ request , func_get_args ( ) ) ; $ transformer = $ this -> getTransformer ( ) ; $ includes = $ request -> input ( 'include' , '' ) ; $ filter = $ request -> input ( 'filter' , false ) ; $ items = $ this -> getRepository ( ) ; if ( $ filter && is_string ( $ filter ) ) { $ filter = json_decode ( $ filter , true ) ; } $ queryFilter = [ ] ; if ( ! empty ( $ filter ) ) { $ queryFilter = new QueryFilter ( $ filter , $ items -> model ( ) , $ this -> getTransformer ( ) ) ; } $ fractal -> parseIncludes ( $ includes ) ; $ resource = $ collection -> setTransformer ( $ transformer ) -> setResourceKey ( $ this -> getResourceKey ( ) ) ; $ paginator = $ items -> paginate ( $ queryFilter , $ transformer -> getSafeEagerLoad ( $ fractal -> getRequestedIncludes ( ) ) , app ( 'context' ) ) ; $ itemCollection = $ paginator -> getCollection ( ) ; $ resource -> setData ( $ itemCollection ) ; $ resource -> setPaginator ( new IlluminatePaginatorAdapter ( $ paginator ) ) ; return $ this -> respondWithCollection ( $ fractal -> createData ( $ resource ) ) ; }
Get a list of objects

@param  Request  $request Request object
@return ResponseInterface Response for request
Get a list of objects