GitHub - profclems/postman-collection-generator: A package that automatically ge...
source link: https://github.com/profclems/postman-collection-generator
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
About
This package automatically generates postman collection from laravel api/web routes with just a single command
Postman Schema
Supports postman collection Schema v2.1.0
Installation
Install this bundle through Composer:
composer require profclems/postman-collection-generator
Supports Auto-discovery for Laravel 5.5+
For older versions add the PostmanCollectionServiceProvider to providers in the config/app.php
'providers' => [ ... \Profclems\PostmanCollectionGenerator\PostmanCollectionServiceProvider::class, ];
Usage
To generate collection for api routes, run
php artisan postman:collection:export NameForCollection --api
This will generate a yyyy_mm_dd_his_NameForCollection_api.json
in your Laravel storage/app
folder.
To generate collection for web routes, run
php artisan postman:collection:export NameForCollection --web
This will generate a yyyy_mm_dd_his_NameForCollection_web.json
in your Laravel storage/app
folder.
Change NameForCollection
to the name you want the collection file saved as.
Options
By default, the url is set to {{base_url}}
which is a postman variable that can be set in your postman environment.
--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
- Add support for other popular PHP frameworks
- Convert postman collection to api/web routes
Contributing
Thank you for considering contributing to the this package! Feel free to submit a PR
Awards / Nominations
License
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK