New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API
779,794 1,053

Larablocks Analysis

andreaselia/laravel-api-to-postman works with Laravel 7 to 13 (latest release v2.3.0, Mar 17, 2026).

Laravel 6 in earlier releases.

Recommendation checks

Recommended

Recommended by Larablocks: meets all 4 checks.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Mar 17, 2026)
  • 36,218 downloads a month (at least 10,000)
  • 1,053 GitHub stars (at least 100)

State

Maintained
  • Last stable release: Mar 17, 2026.
  • 1 release in the last 12 months.
  • First released: Dec 24, 2020.
  • Monthly downloads: 36,218, up 101% from six months ago.
  • 2 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require andreaselia/laravel-api-to-postman
Latest Version:v2.3.0
PHP:^7.4|^8.0
Laravel:7 – 13
Older releases:6
License:MIT
Last Updated:Oct 24, 2026
Links: GitHub  ·  Packagist
Maintainer: AndreasElia

Laravel API to Postman Header

Latest Stable Version

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 and basic auth for routes behind an auth middleware.

For POST and PUT requests that utilizes a FormRequest, you can optionally scaffold the request, and publish rules in raw or human readable format.

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"

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 collection is saved in the postman directory of the disk configured by the disk option (the local disk by default, which is storage/app/private on Laravel 11+ and storage/app on older versions). The full path is printed once the export has finished.

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"

The following usage will generate routes with the basic auth specified.

php artisan export:postman --basic="username:password123"

If both auths are specified, bearer will be favored.

The auth header is only added to routes that use the middleware configured by the auth_middleware option (auth:api by default), or any auth / auth:* middleware such as auth:sanctum.

Instead of passing an option, you can also configure the authentication in your .env file. Options passed to the command take precedence over these values.

POSTMAN_EXPORT_AUTH_METHOD=bearer # or basic
POSTMAN_EXPORT_AUTH_TOKEN=your-token

If a method is set without a token, the requests will use the {{token}} collection variable, which you can fill in from within Postman.

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.

Alternatives to andreaselia/laravel-api-to-postman

samody/laravel-smart-postman-generator

A smart Laravel-to-Postman collection generator focused on clean structure, smar...

3,053 1
hopheartsceo/laravel-postman-exporter

Automatically generate Postman v2.1 collections from your Laravel application ro...

1,381 2

Version History

Version Released PHP Laravel License
v2.3.0 ^7.4|^8.0 ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0 MIT
v2.2.0 ^7.4|^8.0 ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v2.1.0 ^7.4|^8.0 ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v2.0.6 ^7.4|^8.0 ^7.0|^8.0|^9.0|^10.0|^11.0 MIT
v2.0.5 ^7.4|^8.0 ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT