src/PaginateRoute.php
public function pageUrl($page, $full = false)
    {
        $currentPageUrl = $this->router->getCurrentRoute()->uri();

        $url = $this->addPageQuery(str_replace('{pageQuery?}', '', $currentPageUrl), $page, $full);

        foreach ((new RouteParameterBinder($this->router->getCurrentRoute()))->parameters(app('request')) as $parameterName => $parameterValue) {
            $url = str_replace(['{'.$parameterName.'}', '{'.$parameterName.'?}'], $parameterValue, $url);
        }

        $query = Request::getQueryString();

        $query = $query
            ? '?'.$query
            : '';

        return $this->urlGenerator->to($url).$query;
    }
public function pageUrl($page, $full = false)
    {
        $currentPageUrl = $this->router->getCurrentRoute()->uri();

        $url = $this->addPageQuery(str_replace('{pageQuery?}', '', $currentPageUrl), $page, $full);

        foreach ((new RouteParameterBinder($this->router->getCurrentRoute()))->parameters(app('request')) as $parameterName => $parameterValue) {
            $url = str_replace(['{'.$parameterName.'}', '{'.$parameterName.'?}'], $parameterValue, $url);
        }

        $query = Request::getQueryString();

        $query = $query
            ? '?'.$query
            : '';

        return $this->urlGenerator->to($url).$query;
    }
public function pageUrl ( $ page , $ full = false ) { $ currentPageUrl = $ this -> router -> getCurrentRoute ( ) -> uri ( ) ; $ url = $ this -> addPageQuery ( str_replace ( '{pageQuery?}' , '' , $ currentPageUrl ) , $ page , $ full ) ; foreach ( ( new RouteParameterBinder ( $ this -> router -> getCurrentRoute ( ) ) ) -> parameters ( app ( 'request' ) ) as $ parameterName => $ parameterValue ) { $ url = str_replace ( [ '{' . $ parameterName . '}' , '{' . $ parameterName . '?}' ] , $ parameterValue , $ url ) ; } $ query = Request :: getQueryString ( ) ; $ query = $ query ? '?' . $ query : '' ; return $ this -> urlGenerator -> to ( $ url ) . $ query ; }
Generate a page URL, based on the request's current URL.

@param int  $page
@param bool $full Return the full version of the URL in for the first page
Ex. /users/page/1 instead of /users

@return string
Generate a page URL based on the request s current URL .