Skip to content

Commit 76e11ee

Browse files
committed
formatting
1 parent f842345 commit 76e11ee

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Illuminate/Foundation/Console/RouteListCommand.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,18 @@ protected function filterRoute(array $route)
187187
{
188188
if (($this->option('name') && ! Str::contains($route['name'], $this->option('name'))) ||
189189
$this->option('path') && ! Str::contains($route['uri'], $this->option('path')) ||
190-
$this->option('exclude-path') && Str::contains($route['uri'], $this->option('exclude-path')) ||
191190
$this->option('method') && ! Str::contains($route['method'], strtoupper($this->option('method')))) {
192191
return;
193192
}
194193

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+
195202
return $route;
196203
}
197204

@@ -259,8 +266,8 @@ protected function getOptions()
259266
['json', null, InputOption::VALUE_NONE, 'Output the route list as JSON'],
260267
['method', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by method'],
261268
['name', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by name'],
262-
['path', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by path'],
263-
['exclude-path', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by exclude 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'],
264271
['reverse', 'r', InputOption::VALUE_NONE, 'Reverse the ordering of the routes'],
265272
['sort', null, InputOption::VALUE_OPTIONAL, 'The column (domain, method, uri, name, action, middleware) to sort by', 'uri'],
266273
];

0 commit comments

Comments
 (0)