public function fetch($page = 1, $perPage = 15, array $columns = ['*'], array $filter = [], array $sort = [])
    {
        $this->instance = $this->repository->makeQuery();

        $this->multiFilterBy($filter)->multiSortBy($sort);

        $this->parseAliases($this->instance);

        $count = $this->instance->count();
        $items = $this->instance->forPage($page, $perPage)->get($columns);

        $options = [
            'path'  => $this->app->make('request')->url(),
            'query' => compact('page', 'perPage'),
        ];

        return new LengthAwarePaginator($items, $count, $perPage, $page, $options);
    }
public function fetch($page = 1, $perPage = 15, array $columns = ['*'], array $filter = [], array $sort = [])
    {
        $this->instance = $this->repository->makeQuery();

        $this->multiFilterBy($filter)->multiSortBy($sort);

        $this->parseAliases($this->instance);

        $count = $this->instance->count();
        $items = $this->instance->forPage($page, $perPage)->get($columns);

        $options = [
            'path'  => $this->app->make('request')->url(),
            'query' => compact('page', 'perPage'),
        ];

        return new LengthAwarePaginator($items, $count, $perPage, $page, $options);
    }
public function fetch ( $ page = 1 , $ perPage = 15 , array $ columns = [ '*' ] , array $ filter = [ ] , array $ sort = [ ] ) { $ this -> instance = $ this -> repository -> makeQuery ( ) ; $ this -> multiFilterBy ( $ filter ) -> multiSortBy ( $ sort ) ; $ this -> parseAliases ( $ this -> instance ) ; $ count = $ this -> instance -> count ( ) ; $ items = $ this -> instance -> forPage ( $ page , $ perPage ) -> get ( $ columns ) ; $ options = [ 'path' => $ this -> app -> make ( 'request' ) -> url ( ) , 'query' => compact ( 'page' , 'perPage' ) , ] ; return new LengthAwarePaginator ( $ items , $ count , $ perPage , $ page , $ options ) ; }
Fetch collection ordered and filtrated by specified columns for specified page as paginator.

@param int   $page
@param int   $perPage
@param array $filter
@param array $sort
@param array $columns

@return LengthAwarePaginator
Fetch collection ordered and filtrated by specified columns for specified page as paginator .