public function transformPaginator(LengthAwarePaginator $paginator)
    {
        if (!$this->hasTransformer()) {
            return $paginator;
        }

        $items = $this->transform($paginator->items())->toArray();

        return new LengthAwarePaginator($items, $paginator->total(), $paginator->perPage(), $paginator->currentPage());
    }