laravel artisan route 用法

laravel

基本用法是:

1
laravel artisan route 用法

可添加的后缀有:

后缀参数 描述 默认值
–method= Filters the routes by method.
–name= Filters the routes by name.
–path= Filters the routes by path (URI).
–reverse Reverses the order the routes are displayed in the table.
-r Reverses the order the routes are displayed in the table (shortcut to –reverse).
–sort The column to sort by. Accepted values are host, method, uri, name, action or middleware. uri

举例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Filter the route list by name.
php artisan route:list --name=account

# Filter the route list by URI.
php artisan route:list --path='api/v1/'

# Filter the route list by method.
php artisan route:list --method=GET

# The filters can be combined; results will be aggregated using "and" logic. The following command:
php artisan route:list --path=account --method=GET

# Filter the routes and display them in reverse order.
php artisan route:list --method=GET --reverse

# The following is equivalent to the previous example.
php artisan route:list --method=GET -r

# Filter the routes and sort `name` column.
php artisan route:list --method=GET --sort=name