src/Pagination/ConnectionField.php
public function pageInfoResolver(LengthAwarePaginator $paginator): array
    {
        return [
            'total' => $paginator->total(),
            'count' => $paginator->count(),
            'currentPage' => $paginator->currentPage(),
            'lastPage' => $paginator->lastPage(),
            'hasNextPage' => $paginator->hasMorePages(),
            'hasPreviousPage' => $paginator->currentPage() > 1,
            'startCursor' => $paginator->firstItem()
                ? Cursor::encode($paginator->firstItem())
                : null,
            'endCursor' => $paginator->lastItem()
                ? Cursor::encode($paginator->lastItem())
                : null,
        ];
    }
public function pageInfoResolver(LengthAwarePaginator $paginator): array
    {
        return [
            'total' => $paginator->total(),
            'count' => $paginator->count(),
            'currentPage' => $paginator->currentPage(),
            'lastPage' => $paginator->lastPage(),
            'hasNextPage' => $paginator->hasMorePages(),
            'hasPreviousPage' => $paginator->currentPage() > 1,
            'startCursor' => $paginator->firstItem()
                ? Cursor::encode($paginator->firstItem())
                : null,
            'endCursor' => $paginator->lastItem()
                ? Cursor::encode($paginator->lastItem())
                : null,
        ];
    }
public function pageInfoResolver ( LengthAwarePaginator $ paginator ) : array { return [ 'total' => $ paginator -> total ( ) , 'count' => $ paginator -> count ( ) , 'currentPage' => $ paginator -> currentPage ( ) , 'lastPage' => $ paginator -> lastPage ( ) , 'hasNextPage' => $ paginator -> hasMorePages ( ) , 'hasPreviousPage' => $ paginator -> currentPage ( ) > 1 , 'startCursor' => $ paginator -> firstItem ( ) ? Cursor :: encode ( $ paginator -> firstItem ( ) ) : null , 'endCursor' => $ paginator -> lastItem ( ) ? Cursor :: encode ( $ paginator -> lastItem ( ) ) : null , ] ; }
Resolve page info for connection.

@param  \Illuminate\Contracts\Pagination\LengthAwarePaginator  $paginator
@return array
Resolve page info for connection .