src/Pagination/CursorBuilder.php
protected function next(Cursor $cursor, $columns)
    {
        if ($cursor->isAfter()) {
            $this->whereId($cursor->getAfter(), $this->descending ? '<' : '>');
        }

        $items = $this
            ->orderForNext()
            ->get($cursor->getLimit() + 1, $columns);

        $more = $items->count() > $cursor->getLimit();

        return new CursorPaginator(
            $items->slice(0, $cursor->getLimit()),
            $more,
            $cursor,
            $this->key
        );
    }
protected function next(Cursor $cursor, $columns)
    {
        if ($cursor->isAfter()) {
            $this->whereId($cursor->getAfter(), $this->descending ? '<' : '>');
        }

        $items = $this
            ->orderForNext()
            ->get($cursor->getLimit() + 1, $columns);

        $more = $items->count() > $cursor->getLimit();

        return new CursorPaginator(
            $items->slice(0, $cursor->getLimit()),
            $more,
            $cursor,
            $this->key
        );
    }
protected function next ( Cursor $ cursor , $ columns ) { if ( $ cursor -> isAfter ( ) ) { $ this -> whereId ( $ cursor -> getAfter ( ) , $ this -> descending ? '<' : '>' ) ; } $ items = $ this -> orderForNext ( ) -> get ( $ cursor -> getLimit ( ) + 1 , $ columns ) ; $ more = $ items -> count ( ) > $ cursor -> getLimit ( ) ; return new CursorPaginator ( $ items -> slice ( 0 , $ cursor -> getLimit ( ) ) , $ more , $ cursor , $ this -> key ) ; }
Get the next page.

To calculate if there are more items in the list, we ask
for one more item than we actually need for the limit. We then
slice the results to remove this extra item.

@param Cursor $cursor
@param $columns
@return CursorPaginator
@throws \OutOfRangeException
if the cursor contains a before/after id that does not exist.
Get the next page .