protected function buildLengthUnaware()
    {
        $pages = $this->newPages();

        $itemCount = count($this->items);

        if ($itemCount < 1) {
            return $pages;
        }

        $perhapsMorePages = $itemCount >= $this->perPage;
        $pageParameter = $this->getPageParameterName();
        $currentPage = $this->currentPageNumber;
        $baseUrl = $this->baseUrl;

        for ($page=1; $page <= ($currentPage+1); $page++) {

            if (!$perhapsMorePages && $page > $currentPage) {
                break;
            }

            $pages->add($this->newPage([
                'number'      => $page,
                'url'         => $baseUrl ? $baseUrl->query($pageParameter, $page) : '',
                'is_current'  => $page == $currentPage,
                'is_previous' => $page == $currentPage-1,
                'is_next'     => $page == $currentPage+1,
                'is_first'    => $page == 1,
                'is_last'     => $page >= $currentPage && !$perhapsMorePages,
                'offset'      => ($page-1) * $this->perPage
            ]));
        }

        return $pages;

    }
protected function buildLengthUnaware()
    {
        $pages = $this->newPages();

        $itemCount = count($this->items);

        if ($itemCount < 1) {
            return $pages;
        }

        $perhapsMorePages = $itemCount >= $this->perPage;
        $pageParameter = $this->getPageParameterName();
        $currentPage = $this->currentPageNumber;
        $baseUrl = $this->baseUrl;

        for ($page=1; $page <= ($currentPage+1); $page++) {

            if (!$perhapsMorePages && $page > $currentPage) {
                break;
            }

            $pages->add($this->newPage([
                'number'      => $page,
                'url'         => $baseUrl ? $baseUrl->query($pageParameter, $page) : '',
                'is_current'  => $page == $currentPage,
                'is_previous' => $page == $currentPage-1,
                'is_next'     => $page == $currentPage+1,
                'is_first'    => $page == 1,
                'is_last'     => $page >= $currentPage && !$perhapsMorePages,
                'offset'      => ($page-1) * $this->perPage
            ]));
        }

        return $pages;

    }
protected function buildLengthUnaware ( ) { $ pages = $ this -> newPages ( ) ; $ itemCount = count ( $ this -> items ) ; if ( $ itemCount < 1 ) { return $ pages ; } $ perhapsMorePages = $ itemCount >= $ this -> perPage ; $ pageParameter = $ this -> getPageParameterName ( ) ; $ currentPage = $ this -> currentPageNumber ; $ baseUrl = $ this -> baseUrl ; for ( $ page = 1 ; $ page <= ( $ currentPage + 1 ) ; $ page ++ ) { if ( ! $ perhapsMorePages && $ page > $ currentPage ) { break ; } $ pages -> add ( $ this -> newPage ( [ 'number' => $ page , 'url' => $ baseUrl ? $ baseUrl -> query ( $ pageParameter , $ page ) : '' , 'is_current' => $ page == $ currentPage , 'is_previous' => $ page == $ currentPage - 1 , 'is_next' => $ page == $ currentPage + 1 , 'is_first' => $ page == 1 , 'is_last' => $ page >= $ currentPage && ! $ perhapsMorePages , 'offset' => ( $ page - 1 ) * $ this -> perPage ] ) ) ; } return $ pages ; }
Build pages when no total count is available.

@return Pages
Build pages when no total count is available .