雪漫城的风宅

laravel artisan route 用法

· NightingaleWK · 更新于 2023-11-15
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
上一篇:laravel 项目执行 sail up 报 80 端口占用问题下一篇:哎,又把博客迁移了