PHP Classes

Laravel Routes to Postman Collection Generator: Generate routes for an API or Web applications

Recommend this page to a friend!
  Info   View files Documentation   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 44 This week: 1All time: 10,758 This week: 560Up
Version License PHP version Categories
postman-collection-g 1.0.0GNU General Publi...7Tools, Libraries, Design Patterns, PHP 7
Description 

Author

This package can generate postman collection from Laravel routes for an API or Web applications.

It can take a Router object and traverses it to extract the routes for a Web or API application.

The package can generate a JSON file with the route definition that can be used in an application that uses the PostMan application to implement an API.

Innovation Award
PHP Programming Innovation award nominee
June 2020
Number 2


Prize: One official elePHPant Plush Mascott
Some APIs are implemented in PHP using the Laravel framework. Usually they use Router objects to execute the code that is meant to implement each API call.

It can use the Router objects provided to implement a Web application or an API using Laravel to extract JSON configuration for using with the Postman application.

Manuel Lemos
Picture of Clement Sam
  Performance   Level  
Name: Clement Sam is available for providing paid consulting. Contact Clement Sam .
Classes: 4 packages by
Country: Ghana Ghana
Age: 25
All time rank: 29452 in Ghana Ghana
Week rank: 411 Up3 in Ghana Ghana Down
Innovation award
Innovation award
Nominee: 1x

Documentation

Laravel Routes to Postman Collection Generator

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

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

  Files folder image Files  
File Role Description
Files folder imagesrc (2 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file _config.yml Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
  Plain text file ExportPostmanCollection.php Class Class source
  Plain text file PostmanCollectionServiceProvider.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:44
This week:1
All time:10,758
This week:560Up