PHPackages                             phpsa/laravel-postman - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. phpsa/laravel-postman

ActiveLibrary[API Development](/categories/api)

phpsa/laravel-postman
=====================

Export laravel API routes to postman

v5.2.0(2y ago)1014.7k2[1 issues](https://github.com/phpsa/laravel-postman/issues)MITPHPPHP ^8.1

Since Nov 22Pushed 1y agoCompare

[ Source](https://github.com/phpsa/laravel-postman)[ Packagist](https://packagist.org/packages/phpsa/laravel-postman)[ Docs](https://github.com/phpsa/laravel-postman)[ GitHub Sponsors](https://github.com/phpsa)[ RSS](/packages/phpsa-laravel-postman/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (31)Used By (0)

laravel-postman
===============

[](#laravel-postman)

This package allows you to export your API routes to a postman import json file, original work by

Installation
------------

[](#installation)

Install the package via composer

`composer require --dev phpsa/laravel-postman`

Then add the service provider in config/app.php: \]

Configuration
-------------

[](#configuration)

Optionally, publish the package configuration file:

`php artisan vendor:publish --provider="Phpsa\LaravelPostman\ServiceProvider" --tag="config"`

Note: publishing the configuration file is optional, you can use de default package options.

### Options

[](#options)

- LARAVEL\_API\_URL =&gt; Url for the api to use in its variables
- LARAVEL\_POSTMAN\_COLLECTION\_NAME =&gt; your collection name
- LARAVEL\_POSTMAN\_COLLECTION\_DESCRIPTION =&gt; description of collection
- LARAVEL\_POSTMAN\_API\_PREFIX =&gt; comma list of routes to include (default api,oauth)
- LARAVEL\_POSTMAN\_API\_PREFIX\_IGNORE =&gt; comma list of routes to exclude (default \_ignition)
- LARAVEL\_POSTMAN\_SKIP\_HEAD =&gt; skip head routes - default true
- LARAVEL\_POSTMAN\_EXPORT\_DIRECTORY =&gt; where to store the file, default storage folder \];

#### apiURL

[](#apiurl)

This is the base URL for your postman routes

default value: config('app.url')

#### collectionName

[](#collectionname)

This is the postman collection name

default value: the command will ask for it

#### collectionDescription

[](#collectiondescription)

This is the postman collection description

default value: the command will ask for it

#### apiPrefix

[](#apiprefix)

This is the prefix by which we identify the routes to export

default value: 'api'

#### skipHEAD

[](#skiphead)

This avoids creating routes for HEAD method

default value: true

#### exportDirectory

[](#exportdirectory)

The directory to which the postman.json file will be exported

Usage
-----

[](#usage)

### Configuring controllers

[](#configuring-controllers)

Add a property to your entity controller like this:

`public $postmanModel = 'App\MyEntityModel';`

### Add a public method to your model class like this: (optional)

[](#add-a-public-method-to-your-model-class-like-this-optional)

```
/**
 * returns sample body for put/post request
 *
 * @param string $method - POST / PUT / PATCH etc.
 * @param string|null $routeName - the routename from the routes file if set.
 *
 * @return array
 * /
public function getPostmanParams(string $method, ?string $routeName): array
{
    return [
        'key1' => 'sampleValue',
        'key2' => ''
    ];
}
```

This array of params will be used to fill POST and PUT urlencoded form data section in postman. The previous method is just an example, you should return the array of params that you want to see in postman.

if the above method not supplied, will use the model fillable to fill it.

### Documenting endpoints

[](#documenting-endpoints)

Laravel-Postman uses the docblocks above your methods to generate the documentation eg:

```
/**
  * this is the summary - which headlines the description
  *
  * this is the description - which goes on a new line under the summary (optional)
  *
  * @route-name My Custom Route Name (defaults to folder.model.method if not set)
  *
  * @param ...
  ...
  */
```

### Export

[](#export)

`php artisan postman:export`

Optionally you can limit to a specific controller, or list of controllers by passing the `-C` parameter and the controllers you wish to use.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance41

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 58.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~104 days

Recently: every ~155 days

Total

27

Last Release

753d ago

Major Versions

v1.1.2 → 2.0.12020-03-01

2.2.2 → v3.0.02022-03-14

v3.0.0 → v4.0.02022-05-30

v4.0.0 → 5.0.0-b.12022-08-06

v4.1.0 → v5.1.02023-03-07

PHP version history (5 changes)v1.0.0PHP ~5.6|~7.0

v1.1.0PHP &gt;=5.4

2.0.1PHP &gt;=7.1

v3.0.0PHP ^8.0

v5.2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/bbe4c97ef26aca9d6792775ea44a4c83215881b158f2d3894279c7b73bedda3c?d=identicon)[phpsa](/maintainers/phpsa)

---

Top Contributors

[![phpsa](https://avatars.githubusercontent.com/u/952595?v=4)](https://github.com/phpsa "phpsa (33 commits)")[![craigAtCD](https://avatars.githubusercontent.com/u/152445143?v=4)](https://github.com/craigAtCD "craigAtCD (17 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (2 commits)")[![sojeda](https://avatars.githubusercontent.com/u/17851841?v=4)](https://github.com/sojeda "sojeda (2 commits)")[![timack](https://avatars.githubusercontent.com/u/1098068?v=4)](https://github.com/timack "timack (2 commits)")

---

Tags

apilaravelexportgithubPostman

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/phpsa-laravel-postman/health.svg)

```
[![Health](https://phpackages.com/badges/phpsa-laravel-postman/health.svg)](https://phpackages.com/packages/phpsa-laravel-postman)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[dingo/blueprint

API Blueprint documentation generator.

2707.8M22](/packages/dingo-blueprint)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
