profclems / postman-collection-generator
一个自动从Laravel api/web路由生成Postman集合的包
v1.2.0
2021-02-22 21:31 UTC
Requires
- php: >=7.1
- ext-json: *
- ext-mbstring: *
This package is auto-updated.
Last update: 2024-08-29 05:37:00 UTC
README
关于
此包可使用单条命令自动从Laravel api/web路由生成Postman集合
Postman模式
支持Postman集合模式 v2.1.0
安装
通过Composer安装此包
composer require profclems/postman-collection-generator
支持Laravel 5.5+的自动发现
对于旧版本,请将PostmanCollectionServiceProvider添加到config/app.php中的providers
'providers' => [ ... \Profclems\PostmanCollectionGenerator\PostmanCollectionServiceProvider::class, ];
使用方法
要为api路由生成集合,运行
php artisan postman:collection:export NameForCollection --api
这将生成一个yyyy_mm_dd_his_NameForCollection_api.json
文件,保存在您的Laravel storage/app
文件夹中。
要为web路由生成集合,运行
php artisan postman:collection:export NameForCollection --web
这将生成一个yyyy_mm_dd_his_NameForCollection_web.json
文件,保存在您的Laravel storage/app
文件夹中。
将NameForCollection
更改为您希望保存集合文件的名称。
选项
默认情况下,URL设置为{{base_url}}
,这是一个可以在Postman环境中设置的Postman变量。
--api or --web to specify the type of route to export --url to specify the url for the collection. Eg. --url=localhost --port to specify the port. Eg --port=8000
待办事项
- 添加对其他流行PHP框架的支持
- 将Postman集合转换为api/web路由
贡献
感谢您考虑为此包做出贡献!请随意提交PR