src/Pagination/ConnectionField.php
public function edgeResolver(LengthAwarePaginator $paginator): Collection
    {
        $firstItem = $paginator->firstItem();

        return $paginator->values()->map(function ($item, $index) use ($firstItem) {
            return [
                'cursor' => Cursor::encode($firstItem + $index),
                'node' => $item,
            ];
        });
    }
public function edgeResolver(LengthAwarePaginator $paginator): Collection
    {
        $firstItem = $paginator->firstItem();

        return $paginator->values()->map(function ($item, $index) use ($firstItem) {
            return [
                'cursor' => Cursor::encode($firstItem + $index),
                'node' => $item,
            ];
        });
    }
public function edgeResolver ( LengthAwarePaginator $ paginator ) : Collection { $ firstItem = $ paginator -> firstItem ( ) ; return $ paginator -> values ( ) -> map ( function ( $ item , $ index ) use ( $ firstItem ) { return [ 'cursor' => Cursor :: encode ( $ firstItem + $ index ) , 'node' => $ item , ] ; } ) ; }
Resolve edges for connection.

@param  \Illuminate\Contracts\Pagination\LengthAwarePaginator  $paginator
@return \Illuminate\Support\Collection
Resolve edges for connection .