protected function getPaginationData(Select $query, array $options)
    {
        // Get pagination options
        $page = (int) Arr::get($options, 'page');

        if ($page < 1) {
            $page = 1;
        }

        $resultsPerPage = Arr::get(
            $options,
            'resultsPerPage',
            $this->resultsPerPage
        );

        // Get total results
        $resultCount = $this->getQueryResultCount($query);
        $pageCount   = ceil($resultCount / $resultsPerPage);

        return new PaginationData([
            'page'             => $page,
            'page_count'       => $pageCount,
            'result_count'     => $resultCount,
            'results_per_page' => $resultsPerPage
        ]);
    }
protected function getPaginationData(Select $query, array $options)
    {
        // Get pagination options
        $page = (int) Arr::get($options, 'page');

        if ($page < 1) {
            $page = 1;
        }

        $resultsPerPage = Arr::get(
            $options,
            'resultsPerPage',
            $this->resultsPerPage
        );

        // Get total results
        $resultCount = $this->getQueryResultCount($query);
        $pageCount   = ceil($resultCount / $resultsPerPage);

        return new PaginationData([
            'page'             => $page,
            'page_count'       => $pageCount,
            'result_count'     => $resultCount,
            'results_per_page' => $resultsPerPage
        ]);
    }
protected function getPaginationData ( Select $ query , array $ options ) { // Get pagination options $ page = ( int ) Arr :: get ( $ options , 'page' ) ; if ( $ page < 1 ) { $ page = 1 ; } $ resultsPerPage = Arr :: get ( $ options , 'resultsPerPage' , $ this -> resultsPerPage ) ; // Get total results $ resultCount = $ this -> getQueryResultCount ( $ query ) ; $ pageCount = ceil ( $ resultCount / $ resultsPerPage ) ; return new PaginationData ( [ 'page' => $ page , 'page_count' => $ pageCount , 'result_count' => $ resultCount , 'results_per_page' => $ resultsPerPage ] ) ; }
Get data object with pagination data like page and page_count

@param  Select $query
@param  array $options
@return PaginationData
Get data object with pagination data like page and page_count