protected function getPaginationLinks($paginator)
    {
        $links = [];

        $links['self'] = urldecode($paginator->url($paginator->currentPage()));
        $links['first'] = urldecode($paginator->url(1));
        $links['last'] = urldecode($paginator->url($paginator->lastPage()));

        $links['prev'] = urldecode($paginator->url($paginator->currentPage() - 1));
        if ($links['prev'] === $links['self'] || $links['prev'] === '') {
            $links['prev'] = null;
        }
        $links['next'] = urldecode($paginator->nextPageUrl());
        if ($links['next'] === $links['self'] || $links['next'] === '') {
            $links['next'] = null;
        }
        return $links;
    }