This package automatically generates postman collection from laravel api/web routes with just a single command
Supports postman collection Schema v2.1.0
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,
];
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.
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
Thank you for considering contributing to the this package! Feel free to submit a PR