andreaselia / laravel-api-to-postman by AndreasElia

Generate a Postman collection automatically from your Laravel API
359,073
960
20
Package Data
Maintainer Username: AndreasElia
Maintainer Contact: andreaselia@live.co.uk (Andreas Elia)
Package Create Date: 2020-12-22
Package Last Update: 2024-07-23
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-17 03:07:07
Package Statistics
Total Downloads: 359,073
Monthly Downloads: 12,914
Daily Downloads: 151
Total Stars: 960
Total Watchers: 20
Total Forks: 99
Total Open Issues: 0

Laravel API to Postman Header

Latest Stable Version StyleCI

Laravel API to Postman

This package allows you to automatically generate a Postman collection based on your API routes. It also provides basic configuration and support for bearer auth tokens for routes behind an auth middleware.

Postman Schema

The generator works for the latest version of the Postman Schema at the time of publication (v2.1.0).

Installation

Install the package:

composer require andreaselia/laravel-api-to-postman

Publish the config file:

php artisan vendor:publish --provider="AndreasElia\PostmanGenerator\PostmanGeneratorServiceProvider" --tag="postman-config"

Configuration

You can modify any of the api-postman.php config values to suit your export requirements.

Click here to view the config attributes.

Usage

The output of the command being ran is your storage/app directory.

To use the command simply run:

php artisan export:postman

The following usage will generate routes with the bearer token specified.

php artisan export:postman --bearer=1|XXNKXXqJjfzG8XXSvXX1Q4pxxnkXmp8tT8TXXKXX

Examples

This is with the default configuration and a bearer token passed in:

php artisan export:postman --bearer=123456789

Contributing

You're more than welcome to submit a pull request, or if you're not feeling up to it - create an issue so someone else can pick it up.