profclems / postman-collection-generator
A package that automatically generate postman collection from laravel api/web routes
Installs: 26 791
Dependents: 0
Suggesters: 0
Security: 0
Stars: 67
Watchers: 6
Forks: 5
Open Issues: 0
Requires
- php: >=7.1
- ext-json: *
- ext-mbstring: *
This package is auto-updated.
Last update: 2024-10-29 06:18:35 UTC
README
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
ToDo
- 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