PHPackages                             samody/laravel-smart-postman-generator - 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. samody/laravel-smart-postman-generator

ActiveLibrary[API Development](/categories/api)

samody/laravel-smart-postman-generator
======================================

A smart Laravel-to-Postman collection generator focused on clean structure, smart naming, request body generation, and documentation-ready API exports.

v1.0.4(1mo ago)195↓40%MITPHPPHP ^7.4|^8.0CI passing

Since May 7Pushed 1mo agoCompare

[ Source](https://github.com/samody2006/laravel-smart-postman-generator)[ Packagist](https://packagist.org/packages/samody/laravel-smart-postman-generator)[ Docs](https://github.com/samody/laravel-smart-postman-generator)[ RSS](/packages/samody-laravel-smart-postman-generator/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (11)Versions (5)Used By (0)

Laravel Smart Postman Generator
===============================

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

A smarter Laravel-to-Postman exporter focused on generating clean, organized, and documentation-ready Postman collections with minimal manual cleanup.

Built as an enhanced fork of the original:

- Original Package: `andreaselia/laravel-api-to-postman`
- Original Author: Andreas Elia

This project expands the original idea into a more production-ready API documentation generator for modern Laravel applications.

---

Why Use This?
=============

[](#why-use-this)

The common problems with generated Postman collections:

- Endpoints export with raw route paths as names
- Collections become difficult to navigate as APIs grow
- JSON bodies are flat and not representative of actual payloads
- Teams spend time manually renaming requests and organizing folders
- Large APIs require exporting everything repeatedly

This package solves those issues by generating:

- cleaner request names
- grouped request folders
- smarter JSON payloads
- scalable exports
- documentation-ready collections

---

Installation
============

[](#installation)

```
composer require samody/laravel-smart-postman-generator
```

---

Publish Configuration
=====================

[](#publish-configuration)

```
php artisan vendor:publish --tag=postman-config
```

---

Quick Start
===========

[](#quick-start)

Export entire API:

```
php artisan export:postman
```

Export only a specific API section:

```
php artisan export:postman --path=api/user
```

Export with JSON request bodies:

```
php artisan export:postman --body-mode=json
```

Export with bearer authentication:

```
php artisan export:postman --bearer="your-token"
```

---

Features
========

[](#features)

Core Export Features
--------------------

[](#core-export-features)

- ✅ Automatic Laravel route discovery
- ✅ Postman Collection v2.1 export
- ✅ Bearer authentication support
- ✅ Basic authentication support
- ✅ Configurable headers
- ✅ Structured route export
- ✅ CRUD folder generation
- ✅ Docblock descriptions support

---

Smart Export Features
---------------------

[](#smart-export-features)

### Route Path Filtering

[](#route-path-filtering)

Export only a section of your API instead of regenerating the entire collection.

```
php artisan export:postman --path=api/admin
```

Useful for:

- modular APIs
- large projects
- incremental documentation updates
- team-based API exports

---

### JSON Body Support

[](#json-body-support)

Export request bodies as:

- `json`
- `form-data`
- `urlencoded`

Example:

```
'body_format' => 'json',
```

---

### Body Mode Detection

[](#body-mode-detection)

Control how request bodies are generated.

```
'body_mode' => 'auto',
```

Supported modes:

ModeDescriptionformdataAlways generate form-datajsonAlways generate JSONautoAutomatically detect best body type---

### FormRequest Validation Export

[](#formrequest-validation-export)

Automatically parse Laravel FormRequest validation rules and export them into Postman request bodies.

Supports:

- validation descriptions
- required field detection
- nullable fields
- arrays
- nested request fields

---

Smart Naming System (Planned)
=============================

[](#smart-naming-system-planned)

Automatically convert technical route paths into readable Postman request names.

Example:

RouteMethodGenerated Nameapi/user/profileGETGet User Profileapi/user/logoutPOSTRequest User Logoutapi/user/orders/{id}/cancelPOSTCancel User OrderThis removes the need for manually renaming hundreds of requests after export.

---

Automatic Folder Grouping (Planned)
===================================

[](#automatic-folder-grouping-planned)

Automatically organize requests into folders.

Group By Controller
-------------------

[](#group-by-controller)

```
UserController
 ├── Get User Profile
 ├── Update User Profile
 └── Logout User

```

Group By Path
-------------

[](#group-by-path)

```
User
 ├── Profile
 ├── Orders
 └── Notifications

```

Config example:

```
'group_by' => 'controller',
```

Supported options:

```
'controller'
'path'
'none'
```

---

Structured JSON Generation (Planned)
====================================

[](#structured-json-generation-planned)

Generate real nested JSON payloads from FormRequest validation rules.

Current Flat Output
-------------------

[](#current-flat-output)

```
{
  "items.*.product_id": "",
  "items.*.quantity": ""
}
```

Planned Structured Output
-------------------------

[](#planned-structured-output)

```
{
  "items": [
    {
      "product_id": 1,
      "quantity": 1
    }
  ]
}
```

---

Example Value Generation (Planned)
==================================

[](#example-value-generation-planned)

Automatically generate intelligent example values.

Example:

```
{
  "email": "john@example.com",
  "name": "John Doe",
  "quantity": 1,
  "is_active": true
}
```

Potential support:

- Faker integration
- enum value detection
- date examples
- UUID generation
- file placeholders

---

Configuration
=============

[](#configuration)

Configuration file:

```
config/api-postman.php

```

---

Example Configuration
---------------------

[](#example-configuration)

```
return [

    'base_url' => env('APP_URL'),

    'structured' => true,

    'crud_folders' => true,

    'body_mode' => 'auto',

    'body_format' => 'json',

    'enable_formdata' => true,

    'smart_naming' => true,

    'group_by' => 'controller',

];
```

---

Usage
=====

[](#usage)

Export Entire API
-----------------

[](#export-entire-api)

```
php artisan export:postman
```

---

Export Specific API Section
---------------------------

[](#export-specific-api-section)

```
php artisan export:postman --path=api/user
```

---

Export Using JSON Bodies
------------------------

[](#export-using-json-bodies)

```
php artisan export:postman --body-mode=json
```

---

Export With Bearer Token
------------------------

[](#export-with-bearer-token)

```
php artisan export:postman --bearer="your-token"
```

---

Export With Basic Auth
----------------------

[](#export-with-basic-auth)

```
php artisan export:postman --basic="username:password"
```

---

Output Location
===============

[](#output-location)

Generated collections are stored in:

```
storage/app/postman

```

---

Example Generated Improvements
==============================

[](#example-generated-improvements)

Before
------

[](#before)

```
api/user/orders/{id}/cancel

```

After
-----

[](#after)

```
Cancel User Order

```

---

Before
------

[](#before-1)

```
{
  "items.*.product_id": ""
}
```

After
-----

[](#after-1)

```
{
  "items": [
    {
      "product_id": 1
    }
  ]
}
```

---

Roadmap
=======

[](#roadmap)

Phase 1
-------

[](#phase-1)

- JSON body support
- Body mode support
- Route path filtering

---

Phase 2
-------

[](#phase-2)

- Smart request naming
- Automatic folder grouping
- Nested path grouping

---

Phase 3
-------

[](#phase-3)

- Structured JSON generation
- Example value generation
- Faker integration

---

Phase 4
-------

[](#phase-4)

- Response example generation
- OpenAPI support
- Environment export support
- Swagger compatibility

---

Testing
=======

[](#testing)

```
composer test
```

---

Real-World Benefits
===================

[](#real-world-benefits)

Development
-----------

[](#development)

✅ Faster API testing
✅ Cleaner Postman collections
✅ Less manual cleanup
✅ Better onboarding for teams
✅ Easier frontend/backend collaboration

---

Documentation
-------------

[](#documentation)

✅ Documentation-ready exports
✅ Human-readable request names
✅ Organized request grouping
✅ Better payload representation

---

Team Collaboration
------------------

[](#team-collaboration)

✅ Consistent Postman structures
✅ Easier API navigation
✅ Faster endpoint discovery
✅ Cleaner API handoffs

---

Contributing
============

[](#contributing)

Contributions are welcome.

You can:

- open issues
- suggest improvements
- submit pull requests

---

Credits
=======

[](#credits)

Original Package
----------------

[](#original-package)

Andreas Elia
`andreaselia/laravel-api-to-postman`

---

Smart Fork &amp; Enhancements
-----------------------------

[](#smart-fork--enhancements)

Maintained as an enhanced developer-experience focused fork.

---

License
=======

[](#license)

MIT

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance94

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

4

Last Release

32d ago

PHP version history (3 changes)v1.0.0PHP ^8.1

v1.0.1PHP ^8.3

v1.0.3PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/489e6539d16030e5266af9ef15a0e11e34fd71db2c038af482ebc6d46d070af5?d=identicon)[samody2006](/maintainers/samody2006)

---

Top Contributors

[![samody2006](https://avatars.githubusercontent.com/u/9530145?v=4)](https://github.com/samody2006 "samody2006 (11 commits)")

---

Tags

apilaraveldocumentationswaggeropenapigeneratorcollectionREST APIPostmanformrequest

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/samody-laravel-smart-postman-generator/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k625.4k4](/packages/andreaselia-laravel-api-to-postman)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[propaganistas/laravel-disposable-email

Disposable email validator

6012.9M7](/packages/propaganistas-laravel-disposable-email)

PHPackages © 2026

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