> php artisan route:list --help
Usage:
route:list [options]
Options:
--method[=METHOD] Filter the routes by method.
--name[=NAME] Filter the routes by name.
--path[=PATH] Filter the routes by path.
-r, --reverse Reverse the ordering of the routes.
--sort[=SORT] The column (host, method, uri, name, action, middleware) to sort by. [default: "uri"]
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Help:
List all registered routes
使用
--help
可以列出帮助信息,可以看到有个--sort
参数,用于排序,默认是uri
。要使用控制器排序,设置参数为
action
即可。如果需要降序,加上
-r
参数即可