Skip to content

Commit

Permalink
fix route removing undefined index
Browse files Browse the repository at this point in the history
  • Loading branch information
Jari Pekkala authored and Jari Pekkala committed Mar 20, 2017
1 parent fb6afbb commit 713483d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Illuminate/Routing/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ public function add(Route $route)
public function remove(Route $route)
{
$domainAndUri = $route->domain().$route->uri();
$controller = trim($route->getAction()['uses'], '\\');

foreach ($route->methods() as $method) {
unset($this->routes[$method][$domainAndUri]);
}

unset($this->allRoutes[$method.$domainAndUri]);
unset($this->actionList[trim($route->getAction()['controller'], '\\')]);

if ($controller && isset($this->actionList[$controller])) {
unset($this->actionList[$controller]);
}

$this->refreshNameLookups();
}
Expand Down

0 comments on commit 713483d

Please sign in to comment.