Skip to content

Commit

Permalink
fix middleware group display
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 15, 2021
1 parent fcc9467 commit d9e28dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Foundation/Console/RouteListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public function __construct(Router $router)
*/
public function handle()
{
$this->router->flushMiddlewareGroups();

if (empty($this->router->getRoutes())) {
return $this->error("Your application doesn't have any routes.");
}
Expand Down Expand Up @@ -163,7 +165,7 @@ protected function displayRoutes(array $routes)
}

/**
* Get before filters.
* Get the middleware for the route.
*
* @param \Illuminate\Routing\Route $route
* @return string
Expand Down
12 changes: 12 additions & 0 deletions src/Illuminate/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,18 @@ public function pushMiddlewareToGroup($group, $middleware)
return $this;
}

/**
* Flush the router's middleware groups.
*
* @return $this
*/
public function flushMiddlewareGroups()
{
$this->middlewareGroups = [];

return $this;
}

/**
* Add a new route parameter binder.
*
Expand Down

0 comments on commit d9e28dc

Please sign in to comment.