Skip to content

Commit 9c9f858

Browse files
committed
Merge branch 'patch-1' into 8.x
2 parents 9d80189 + 76e11ee commit 9c9f858

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Illuminate/Foundation/Console/RouteListCommand.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ protected function filterRoute(array $route)
191191
return;
192192
}
193193

194+
if ($this->option('except-path')) {
195+
foreach (explode(',', $this->option('except-path')) as $path) {
196+
if (Str::contains($route['uri'], $path)) {
197+
return;
198+
}
199+
}
200+
}
201+
194202
return $route;
195203
}
196204

@@ -258,7 +266,8 @@ protected function getOptions()
258266
['json', null, InputOption::VALUE_NONE, 'Output the route list as JSON'],
259267
['method', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by method'],
260268
['name', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by name'],
261-
['path', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by path'],
269+
['path', null, InputOption::VALUE_OPTIONAL, 'Only show routes matching the given path pattern'],
270+
['except-path', null, InputOption::VALUE_OPTIONAL, 'Do not display the routes matching the given path pattern'],
262271
['reverse', 'r', InputOption::VALUE_NONE, 'Reverse the ordering of the routes'],
263272
['sort', null, InputOption::VALUE_OPTIONAL, 'The column (domain, method, uri, name, action, middleware) to sort by', 'uri'],
264273
];

0 commit comments

Comments
 (0)