1.安装swagger-php插件
composer require zircote/swagger-php
2.下载swagger-ui
https://pan.baidu.com/s/1GcRe6VAYYLoe6XWOuib97w
3.生成swagger.json
php /opt/lampp/htdocs/tp5/vendor/zircote/swagger-php/bin/swagger /opt/lampp/htdocs/tp5/vendor/zircote/swagger-php/Examples -o /opt/lampp/htdocs/tp5/public/swagger-docs