src/Uri/UriGenerator.php
public function route($name, array $params = null, $secure = false)
    {
        $routes = file_exists(cache_path('routes.php'))
            ? require cache_path('routes.php')
            : app('route')->getRoutes();

        $found = false;
        foreach ($routes as $key => $value) {
            if ($value['alias'] == $name) {
                $found = true;
                break;
            }
        }

        if ($found) {
            if (strstr($routes[$key]['route'], '{')) {
                $segment = explode('/', $routes[$key]['route']);
                $i = 0;
                foreach ($segment as $key => $value) {
                    if (strstr($value, '{')) {
                        $segment[$key] = $params[$i];
                        $i++;
                    }
                }
                $newUrl = implode('/', $segment);
            } else {
                $newUrl = $routes[$key]['route'];
            }

            $data = str_replace($this->base, '', $this->url) . '/' . $newUrl;
            return $this->getUrl($data, $secure);
        }

        return $this->getUrl($this->url, $secure);
    }
public function route($name, array $params = null, $secure = false)
    {
        $routes = file_exists(cache_path('routes.php'))
            ? require cache_path('routes.php')
            : app('route')->getRoutes();

        $found = false;
        foreach ($routes as $key => $value) {
            if ($value['alias'] == $name) {
                $found = true;
                break;
            }
        }

        if ($found) {
            if (strstr($routes[$key]['route'], '{')) {
                $segment = explode('/', $routes[$key]['route']);
                $i = 0;
                foreach ($segment as $key => $value) {
                    if (strstr($value, '{')) {
                        $segment[$key] = $params[$i];
                        $i++;
                    }
                }
                $newUrl = implode('/', $segment);
            } else {
                $newUrl = $routes[$key]['route'];
            }

            $data = str_replace($this->base, '', $this->url) . '/' . $newUrl;
            return $this->getUrl($data, $secure);
        }

        return $this->getUrl($this->url, $secure);
    }
public function route ( $ name , array $ params = null , $ secure = false ) { $ routes = file_exists ( cache_path ( 'routes.php' ) ) ? require cache_path ( 'routes.php' ) : app ( 'route' ) -> getRoutes ( ) ; $ found = false ; foreach ( $ routes as $ key => $ value ) { if ( $ value [ 'alias' ] == $ name ) { $ found = true ; break ; } } if ( $ found ) { if ( strstr ( $ routes [ $ key ] [ 'route' ] , '{' ) ) { $ segment = explode ( '/' , $ routes [ $ key ] [ 'route' ] ) ; $ i = 0 ; foreach ( $ segment as $ key => $ value ) { if ( strstr ( $ value , '{' ) ) { $ segment [ $ key ] = $ params [ $ i ] ; $ i ++ ; } } $ newUrl = implode ( '/' , $ segment ) ; } else { $ newUrl = $ routes [ $ key ] [ 'route' ] ; } $ data = str_replace ( $ this -> base , '' , $ this -> url ) . '/' . $ newUrl ; return $ this -> getUrl ( $ data , $ secure ) ; } return $ this -> getUrl ( $ this -> url , $ secure ) ; }
Get route uri value with params.

@param string $name
@param array  $params
@param bool   $secure

@return string
Get route uri value with params .