andreaselia / laravel-api-to-postman
自动从您的Laravel API生成Postman集合
v2.0.6
2024-07-23 15:33 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- illuminate/config: ^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/console: ^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/contracts: ^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/routing: ^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^7.0|^8.0|^9.0|^10.0|^11.0
- phpstan/phpdoc-parser: ^1.26
Requires (Dev)
- laravel/pint: ^1.13
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.0|^11.0
- dev-main
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.16.0
- v1.15.0
- v1.14.0
- v1.13.0
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.0
- v1.10.1
- v1.10.0
- v1.9.0
- v1.8.0
- v1.7.10
- v1.7.9
- v1.7.8
- v1.7.7
- v1.7.6
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- dev-2.0-old
This package is auto-updated.
Last update: 2024-09-23 15:54:19 UTC
README
Laravel API to Postman
此包允许您根据API路由自动生成Postman集合。它还提供了对位于认证中间件之后的路由的bearer认证令牌和基本认证的基本配置和支持。
对于使用FormRequest的POST
和PUT
请求,您可以可选地构建请求,并以原始或可读格式发布规则。
Postman Schema
生成器适用于发布时的最新Postman Schema版本(v2.1.0)。
安装
安装包
composer require andreaselia/laravel-api-to-postman
发布配置文件
php artisan vendor:publish --provider="AndreasElia\PostmanGenerator\PostmanGeneratorServiceProvider" --tag="postman-config"
配置
您可以修改任何api-postman.php
配置值以符合您的导出需求。
点击这里查看配置属性。
用法
命令运行的输出是您的storage/app目录。
要使用该命令,只需运行
php artisan export:postman
以下用法将生成带有指定bearer令牌的路由。
php artisan export:postman --bearer="1|XXNKXXqJjfzG8XXSvXX1Q4pxxnkXmp8tT8TXXKXX"
以下用法将生成带有指定基本认证的路由。
php artisan export:postman --basic="username:password123"
如果指定了两种认证方式,将优先使用bearer。
示例
这是默认配置和传入bearer令牌的情况
php artisan export:postman --bearer=123456789
贡献
您随时可以提交一个拉取请求,或者如果您觉得没有心情 - 创建一个问题,以便其他人可以接手。