Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 17, 2021
1 parent f842345 commit 76e11ee
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Illuminate/Foundation/Console/RouteListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,18 @@ protected function filterRoute(array $route)
{
if (($this->option('name') && ! Str::contains($route['name'], $this->option('name'))) ||
$this->option('path') && ! Str::contains($route['uri'], $this->option('path')) ||
$this->option('exclude-path') && Str::contains($route['uri'], $this->option('exclude-path')) ||
$this->option('method') && ! Str::contains($route['method'], strtoupper($this->option('method')))) {
return;
}

if ($this->option('except-path')) {
foreach (explode(',', $this->option('except-path')) as $path) {
if (Str::contains($route['uri'], $path)) {
return;
}
}
}

return $route;
}

Expand Down Expand Up @@ -259,8 +266,8 @@ protected function getOptions()
['json', null, InputOption::VALUE_NONE, 'Output the route list as JSON'],
['method', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by method'],
['name', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by name'],
['path', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by path'],
['exclude-path', null, InputOption::VALUE_OPTIONAL, 'Filter the routes by exclude path'],
['path', null, InputOption::VALUE_OPTIONAL, 'Only show routes matching the given path pattern'],
['except-path', null, InputOption::VALUE_OPTIONAL, 'Do not display the routes matching the given path pattern'],
['reverse', 'r', InputOption::VALUE_NONE, 'Reverse the ordering of the routes'],
['sort', null, InputOption::VALUE_OPTIONAL, 'The column (domain, method, uri, name, action, middleware) to sort by', 'uri'],
];
Expand Down

0 comments on commit 76e11ee

Please sign in to comment.