src/Concerns/CursorPagination.php
/**
     * Create CursorPaginator instance after applying the relevant query and retrieving data.
     *
     * @param   mixed $id
     * @param   bool $isBefore
     * @param   int|null $perPage
     * @param   string|array|null $cursorColumn
     * @param   string|null $primaryKey
     * @return  CursorPaginator
     */
Create CursorPaginator instance after applying the relevant query and retrieving data.
Create CursorPaginator instance after applying the relevant query and retrieving data .
protected function newCursorPaginator($id = null, $isBefore = false, $perPage = null, $cursorColumn = null, $primaryKey = null)
    {
        if ($isBefore) {
            $query = $this->before($id, $perPage, $cursorColumn, $primaryKey);
        } else {
            $query = $this->after($id, $perPage, $cursorColumn, $primaryKey);
        }
        $items = ($total = $query->count()) ? $query->get() : $this->newCollection();
        return new CursorPaginator($items, $id, $perPage, $total);
    }
protected function newCursorPaginator ( $ id = null , $ isBefore = false , $ perPage = null , $ cursorColumn = null , $ primaryKey = null ) { if ( $ isBefore ) { $ query = $ this -> before ( $ id , $ perPage , $ cursorColumn , $ primaryKey ) ; } else { $ query = $ this -> after ( $ id , $ perPage , $ cursorColumn , $ primaryKey ) ; } $ items = ( $ total = $ query -> count ( ) ) ? $ query -> get ( ) : $ this -> newCollection ( ) ; return new CursorPaginator ( $ items , $ id , $ perPage , $ total ) ; }
Create CursorPaginator instance after applying the relevant query and retrieving data.
Create CursorPaginator instance after applying the relevant query and retrieving data .