From 76e11ee97fc8068be1d55986b4524d4c329af387 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 17 Mar 2021 07:49:06 -0500 Subject: [PATCH] formatting --- .../Foundation/Console/RouteListCommand.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Foundation/Console/RouteListCommand.php b/src/Illuminate/Foundation/Console/RouteListCommand.php index c9844c6d81ce..8a24c5dfb8bc 100644 --- a/src/Illuminate/Foundation/Console/RouteListCommand.php +++ b/src/Illuminate/Foundation/Console/RouteListCommand.php @@ -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; } @@ -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'], ];