Skip to content

Commit

Permalink
intelligently drop unnamed prefix name routes when caching (#31917)
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell authored Mar 12, 2020
1 parent 8c40647 commit d58f9e2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Illuminate/Routing/AbstractRouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,14 @@ public function toSymfonyRouteCollection()
*/
protected function addToSymfonyRoutesCollection(SymfonyRouteCollection $symfonyRoutes, Route $route)
{
if (! $name = $route->getName()) {
$name = $route->getName();

if (Str::endsWith($name, '.') &&
! is_null($symfonyRoutes->get($name))) {
$name = null;
}

if (! $name) {
$route->name($name = $this->generateRouteName());

$this->add($route);
Expand Down

0 comments on commit d58f9e2

Please sign in to comment.