protected function makeFromPaginator(Paginator $paginator):ResourceInterface
    {
        $resource = static::makeFromCollection($paginator->getCollection());

        if ($resource instanceof CollectionResource) {
            $queryParams = array_diff_key(app('request')->all(), array_flip(['page']));
            $paginator->appends($queryParams);

            $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
        }

        return $resource;
    }