Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Illuminate/Routing/UrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ public function current()
return $this->to($this->request->getPathInfo());
}

/**
* Get the current URL with one or more replaced parameters
*
* @param array $routeParameters
* @param array $getParameters
* @param bool $absolute
* @return string
*/
public function alter(array $routeParameters = array(), array $getParameters = array(), $absolute = true)
{
$replacedRouteParameters = $routeParameters + $this->request->route()->parameters();
$replacedGetParameters = $getParameters + $this->request->query->all();

return $this->toRoute($this->request->route(), $replacedRouteParameters, $absolute)
. $this->getRouteQueryString($replacedGetParameters);
}

/**
* Get the URL for the previous request.
*
Expand Down