Illuminate\Routing\UrlGenerator::replaceRouteParameters PHP Method

replaceRouteParameters() protected method

Replace all of the wildcard parameters for a route path.
protected replaceRouteParameters ( string $path, array &$parameters ) : string
$path string
$parameters array
return string
    protected function replaceRouteParameters($path, array &$parameters)
    {
        $path = $this->replaceNamedParameters($path, $parameters);
        $path = preg_replace_callback('/\\{.*?\\}/', function ($match) use(&$parameters) {
            return empty($parameters) && !Str::endsWith($match[0], '?}') ? $match[0] : array_shift($parameters);
        }, $path);
        return trim(preg_replace('/\\{.*?\\?\\}/', '', $path), '/');
    }