public function setLinks()
    {
        // Only required for collections as items contain links by default
        if ($this->resource instanceof Collection && $paginator = $this->resource->getPaginator()) {
            $pagination = new Pagination($paginator);
            $this->links = $pagination->generateCollectionLinks();
        } else {
            unset($this->links);
        }

        return $this;
    }