PHPackages                             yasin\_tgh/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. yasin\_tgh/laravel-postman

ActiveLibrary[API Development](/categories/api)

yasin\_tgh/laravel-postman
==========================

A powerful package to automatically generate Postman collections from your Laravel routes with intelligent organization and rich documentation capabilities.

v1.4.6(2mo ago)32546.6k↓41.4%25[2 issues](https://github.com/yasintqvi/laravel-postman/issues)MITPHPPHP ^8.1

Since May 8Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/yasintqvi/laravel-postman)[ Packagist](https://packagist.org/packages/yasin_tgh/laravel-postman)[ RSS](/packages/yasin-tgh-laravel-postman/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (20)Used By (0)

Laravel Postman Documentation Generator
=======================================

[](#laravel-postman-documentation-generator)

[![Latest Version](https://camo.githubusercontent.com/632565034b28d6c1dfeb97ff0f8e3dd238127aeb190bc25bb1cea6c9135c9d7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796173696e5f7467682f6c61726176656c2d706f73746d616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yasin_tgh/laravel-postman)

Automatically generate Postman collections from your Laravel API routes with flexible organization and authentication support.

Features
--------

[](#features)

- Generate Postman collections with one command
- Automatic request body generation from FormRequest validation rules
- Multiple organization strategies (route prefix, controller, nested paths)
- Built-in authentication support (Bearer, Basic Auth, API Keys)
- Customizable route filtering
- Environment variable support for sensitive data

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

[](#installation)

Install via Composer:

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

Publish the config file:

```
php artisan vendor:publish --provider="YasinTgh\LaravelPostman\PostmanServiceProvider" --tag="postman-config"
```

Basic Usage
-----------

[](#basic-usage)

Generate documentation:

```
php artisan postman:generate
```

The collection will be saved to: `storage/postman/api_collection.json`

Configuration Guide
-------------------

[](#configuration-guide)

### Route Organization

[](#route-organization)

Configure how API routes are organized in Postman folders, how request names are formatted, and how request bodies are generated, including optional default values for fields.

```
'structure' => [
    'folders' => [
        'strategy' => 'nested_path', // 'prefix', 'nested_path', or 'controller'
        'max_depth' => 3, // Only for nested_path strategy
        'mapping' => [
            'admin' => 'Administration' // Custom folder name mapping
        ]
    ],

    'naming_format' => '[{method}] {uri}', // placeholders: {method} {uri} {controller} {action}

    /**
    * Request body settings:
    * - default_body_type: 'raw' or 'formdata'
    * - default_values: preset values applied to generated fields
    */
    'requests' => [
        'default_body_type' => 'raw',

        'default_values' => [
            // 'email' => 'test@example.com',
            // 'password' => '123456',
        ],
    ],

]
```

### Route Filtering

[](#route-filtering)

Control which routes are included:

```
'routes' => [
    'prefix' => 'api', // Base API prefix

    'include' => [
        'patterns' => ['api/users/*'], // Wildcard patterns
        'middleware' => ['api'], // Only routes with these middleware
        'controllers' => [App\Http\Controllers\UserController::class] // Specific controllers
    ],

    'exclude' => [
        'patterns' => ['admin/*'],
        'middleware' => ['debug'],
        'controllers' => [App\Http\Controllers\TestController::class]
    ]
]
```

### Authentication Setup

[](#authentication-setup)

Document your API authentication:

```
'auth' => [
    'enabled' => true,
    'type' => 'bearer', // 'bearer', 'basic', or 'api_key'
    'location' => 'header', // 'header' or 'query' for API keys

    'default' => [
        'token' => env('POSTMAN_AUTH_TOKEN'),
        'username' => env('POSTMAN_AUTH_USER'),
        'password' => env('POSTMAN_AUTH_PASSWORD'),
        'key_name' => 'X-API-KEY',
        'key_value' => env('POSTMAN_API_KEY')
    ],

    'protected_middleware' => ['auth:api', 'auth:sanctum']
]
```

### Output Configuration

[](#output-configuration)

```
'output' => [
        'driver' => env('POSTMAN_STORAGE_DISK', 'local'),

        // Storage path for generated files
        'path' => env('POSTMAN_STORAGE_DIR', storage_path('postman')),

        // File naming pattern (date will be appended)
        'filename' => env('POSTMAN_STORAGE_FILE', 'api_collection'),
    ],
```

Authentication Examples
-----------------------

[](#authentication-examples)

### Bearer Token

[](#bearer-token)

```
'auth' => [
    'enabled' => true,
    'type' => 'bearer',
    'default' => [
        'token' => 'your-bearer-token'
    ]
]
```

### Basic Auth

[](#basic-auth)

```
'auth' => [
    'enabled' => true,
    'type' => 'basic',
    'default' => [
        'username' => 'api-user',
        'password' => 'secret'
    ]
]
```

### API Key

[](#api-key)

```
'auth' => [
    'enabled' => true,
    'type' => 'api_key',
    'location' => 'header', // or 'query'
    'default' => [
        'key_name' => 'X-API-KEY',
        'key_value' => 'your-api-key-123'
    ]
]
```

### Environment Variables

[](#environment-variables)

Use `.env` values for sensitive data:

```
'auth' => [
    'default' => [
        'token' => env('POSTMAN_DEMO_TOKEN', 'test-token')
    ]
]
```

Output Example
--------------

[](#output-example)

Generated Postman collection will:

- Group routes by your chosen strategy
- Apply authentication to protected routes
- Include all configured headers
- Use variables for base URL and auth credentials

```
{
  "info": {
    "name": "My API",
    "description": "API Documentation"
  },
  "variable": [
    {"key": "base_url", "value": "https://api.example.com"},
    {"key": "auth_token", "value": "your-token"}
  ],
  "item": [
    {
      "name": "[GET] users",
      "request": {
        "method": "GET",
        "body": {
          "mode": "raw",
          "raw": "{\"email\":\"user@example.com\",\"password\":\"password123\"}"
        },
        "auth": {
          "type": "bearer",
          "bearer": [{"key": "token", "value": "{{auth_token}}"}]
        }
      }
    }
  ]
}
```

🤝 Contributing
--------------

[](#-contributing)

Pull requests are welcome! For major changes, please open an issue first.

License
-------

[](#license)

[MIT](./LICENSE)

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance85

Actively maintained with recent releases

Popularity50

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.5% 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 ~24 days

Recently: every ~60 days

Total

15

Last Release

75d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0be87dc7c7a052dc831ec45a294d1b68b0c851afbeb7a81762d8a17b2ad86c6a?d=identicon)[yasin.tqvi](/maintainers/yasin.tqvi)

---

Top Contributors

[![yasintqvi](https://avatars.githubusercontent.com/u/96473270?v=4)](https://github.com/yasintqvi "yasintqvi (77 commits)")[![essejblack](https://avatars.githubusercontent.com/u/79364396?v=4)](https://github.com/essejblack "essejblack (8 commits)")[![jorbascrumps](https://avatars.githubusercontent.com/u/5909516?v=4)](https://github.com/jorbascrumps "jorbascrumps (1 commits)")[![RRosalia](https://avatars.githubusercontent.com/u/59835574?v=4)](https://github.com/RRosalia "RRosalia (1 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[spatie/laravel-flare

Send Laravel errors to Flare

111.4M7](/packages/spatie-laravel-flare)

PHPackages © 2026

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