@@ -187,11 +187,18 @@ protected function filterRoute(array $route)
187
187
{
188
188
if (($ this ->option ('name ' ) && ! Str::contains ($ route ['name ' ], $ this ->option ('name ' ))) ||
189
189
$ this ->option ('path ' ) && ! Str::contains ($ route ['uri ' ], $ this ->option ('path ' )) ||
190
- $ this ->option ('exclude-path ' ) && Str::contains ($ route ['uri ' ], $ this ->option ('exclude-path ' )) ||
191
190
$ this ->option ('method ' ) && ! Str::contains ($ route ['method ' ], strtoupper ($ this ->option ('method ' )))) {
192
191
return ;
193
192
}
194
193
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
+
195
202
return $ route ;
196
203
}
197
204
@@ -259,8 +266,8 @@ protected function getOptions()
259
266
['json ' , null , InputOption::VALUE_NONE , 'Output the route list as JSON ' ],
260
267
['method ' , null , InputOption::VALUE_OPTIONAL , 'Filter the routes by method ' ],
261
268
['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 ' ],
264
271
['reverse ' , 'r ' , InputOption::VALUE_NONE , 'Reverse the ordering of the routes ' ],
265
272
['sort ' , null , InputOption::VALUE_OPTIONAL , 'The column (domain, method, uri, name, action, middleware) to sort by ' , 'uri ' ],
266
273
];
0 commit comments