Skip to content

Commit

Permalink
Route names must be unique
Browse files Browse the repository at this point in the history
  • Loading branch information
saeideng authored and markstory committed Aug 19, 2016
1 parent 25bcf1b commit 90a95bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Routing/RouteCollection.php
Expand Up @@ -77,6 +77,12 @@ public function add(Route $route, array $options = [])

// Explicit names
if (isset($options['_name'])) {
if(isset($this->_named[$options['_name']])){
throw new MissingRouteException([
'url' => $options['_name'],
'message' => 'A named route was found for "%s" that used twice,Route names must be unique across your entire application.'
]);
}
$this->_named[$options['_name']] = $route;
}

Expand Down

0 comments on commit 90a95bd

Please sign in to comment.