Laravel6 Swagger 使用

composer阿里云镜像源配置 链接 (opens new window)

# 全局配置
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

# 取消配置
composer config -g --unset repos.packagist
copy success
1
2
3
4
5
# 1.下载依赖
composer require "darkaonline/l5-swagger:~6.0"

# 2.生成配置
php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"

# 3.给接口添加注解

# 4.生成接口文档
php artisan  l5-swagger:generate
copy success
1
2
3
4
5
6
7
8
9
10

Swagger 使用 (opens new window)