PHPackages                             oooiik/laravel-export-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. oooiik/laravel-export-postman

ActiveLibrary[API Development](/categories/api)

oooiik/laravel-export-postman
=============================

Automatically generate a Postman collection based on your API routes.

0.1.10(1mo ago)01.5k↓86.5%2[4 issues](https://github.com/oooiik/laravel-export-postman/issues)MITPHPPHP ^7.1|^8.0

Since May 20Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/oooiik/laravel-export-postman)[ Packagist](https://packagist.org/packages/oooiik/laravel-export-postman)[ Docs](https://github.com/oooiik/laravel-export-postman)[ RSS](/packages/oooiik-laravel-export-postman/feed)WikiDiscussions master Synced 3d ago

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

Laravel Export to Postman
=========================

[](#laravel-export-to-postman)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1d575ab811c0c406f2416ac6d5d4976b1747f50157b981a61ad5b539c4233da4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6f6f69696b2f6c61726176656c2d6578706f72742d706f73746d616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oooiik/laravel-export-postman)[![Total Downloads](https://camo.githubusercontent.com/adc24941310ad49bcdde8928bbeaedae5445bd5f2f658e5c7919bc8b143aae54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6f6f69696b2f6c61726176656c2d6578706f72742d706f73746d616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oooiik/laravel-export-postman)[![PHP Version](https://camo.githubusercontent.com/6511e13fe2ad2821b37e04bb0b23b28382c1d244d85f4cf8bb5def441c25b343/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6f6f6f69696b2f6c61726176656c2d6578706f72742d706f73746d616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/oooiik/laravel-export-postman)[![License](https://camo.githubusercontent.com/a659198e0ce3cd8943e927a337fd3fdf5631d37c1a3c5d237eec7561767516e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f6f6f69696b2f6c61726176656c2d6578706f72742d706f73746d616e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Generate a [Postman Collection v2.1](https://schema.postman.com/) from your Laravel API routes — with a single Artisan command.

Annotate your controllers with simple PHPDoc tags to control authentication, headers, descriptions, and even Postman pre-request and test scripts. The output is a ready-to-import JSON collection — no manual route copying, no drift between code and docs.

Features
--------

[](#features)

- 🚀 **One-command export** — `php artisan postman:export` and you're done
- 🔐 **Auth support** — Bearer tokens, no-auth, parent-inherited, per-endpoint
- 📝 **Rich annotations** — descriptions, headers, scripts via standard PHPDoc
- 📂 **External file sources** — load descriptions and scripts from `base_path()` or `resource_path()`
- ⚡ **Pre-request &amp; test scripts** — inject Postman JavaScript directly from your code
- 🎯 **Folder grouping** — collections organized by route prefix
- 🧩 **Laravel 6 → 12** — broad compatibility, PHP 7.1+ through 8.x

Requirements
------------

[](#requirements)

- PHP 7.1 or higher
- Laravel 6.x — 12.x

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

[](#installation)

```
composer require oooiik/laravel-export-postman
```

Publish the config (optional):

```
php artisan vendor:publish --provider="Oooiik\LaravelExportPostman\ExportPostmanServiceProvider"
```

Quick Start
-----------

[](#quick-start)

Export your routes to a Postman collection:

```
php artisan postman:export
```

The collection file will be created in your configured storage path. Import it into Postman → **File → Import**.

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

[](#configuration)

Edit `config/export-postman.php` after publishing:

```
return [
    'name'        => env('APP_NAME', 'Laravel API'),
    'output_path' => storage_path('app/postman'),
    'base_url'    => env('APP_URL', 'http://localhost'),
    // ... and more
];
```

Annotation Reference
--------------------

[](#annotation-reference)

Add PHPDoc annotations to your controller methods or closures to enrich the generated collection.

### Authentication

[](#authentication)

AnnotationDescription`@AuthNo`No authentication for this endpoint`@AuthParent`Inherit authentication from the parent folder`@AuthBearer [token]`Use a Bearer token (literal value or Postman variable)```
/**
 * @AuthBearer {{access_token}}
 */
public function show($id) { /* ... */ }
```

### Headers

[](#headers)

Use `@Header key => value` for custom request headers. Multiple `@Header` annotations are supported.

```
/**
 * @Header Accept => application/json
 * @Header X-Tenant-Id => {{tenant_id}}
 */
public function index() { /* ... */ }
```

### Descriptions

[](#descriptions)

Three flavors — inline, file from `base_path()`, file from `resource_path()`. They can be combined.

AnnotationSource`@DescriptionContext [text]`Inline markdown text`@DescriptionBasePath [path]`File path relative to `base_path()``@DescriptionResourcePath [path]`File path relative to `resource_path()````
/**
 * @DescriptionContext Returns a paginated list of orders for the authenticated user.
 * @DescriptionResourcePath docs/api/orders-index.md
 */
public function index() { /* ... */ }
```

### Pre-request Scripts

[](#pre-request-scripts)

Inject Postman JavaScript that runs **before** the request is sent. Useful for token refresh, signature generation, or dynamic variables.

AnnotationSource`@PreRequestScriptContext [js]`Inline JavaScript`@PreRequestScriptFileBasePath [path]`JS file relative to `base_path()``@PreRequestScriptFileResourcePath [path]`JS file relative to `resource_path()````
/**
 * @PreRequestScriptFileResourcePath postman/scripts/refresh-token.js
 */
public function transfer() { /* ... */ }
```

### Test Scripts

[](#test-scripts)

Inject Postman JavaScript that runs **after** the response is received. Use for assertions or extracting values into environment variables.

AnnotationSource`@TestScriptContext [js]`Inline JavaScript`@TestScriptFileBasePath [path]`JS file relative to `base_path()``@TestScriptFileResourcePath [path]`JS file relative to `resource_path()````
/**
 * @TestScriptContext pm.test("Status 200", () => pm.response.to.have.status(200));
 */
public function login() { /* ... */ }
```

Full Example
------------

[](#full-example)

```
/**
 * @AuthBearer {{access_token}}
 * @Header Accept => application/json
 * @Header X-Tenant-Id => {{tenant_id}}
 * @DescriptionContext Creates a new order for the authenticated user.
 * @DescriptionResourcePath docs/api/orders-create.md
 * @PreRequestScriptFileResourcePath postman/scripts/sign-request.js
 * @TestScriptContext pm.test("Created", () => pm.response.to.have.status(201));
 */
public function store(StoreOrderRequest $request)
{
    // ...
}
```

Compatibility Matrix
--------------------

[](#compatibility-matrix)

LaravelPHPStatus12.x8.2+✅ Supported11.x8.2+✅ Supported10.x8.1+✅ Supported9.x8.0+✅ Supported8.x7.3+✅ Supported7.x7.2.5+✅ Supported6.x7.2+✅ SupportedContributing
------------

[](#contributing)

Pull requests are welcome. For larger changes, please open an issue first to discuss the direction.

Feature ideas, bug reports, and questions → [GitHub Issues](https://github.com/oooiik/laravel-export-postman/issues).

Credits
-------

[](#credits)

- [Obidjon Toshev](https://oooiik.com) — author &amp; maintainer
- All [contributors](https://github.com/oooiik/laravel-export-postman/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). See [LICENSE](LICENSE) for details.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance93

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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 ~370 days

Total

3

Last Release

36d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f56b318fe17172a3b59e47d2e378a4c415fecc96ed642024d3a2a51a0356220?d=identicon)[oooiik](/maintainers/oooiik)

---

Top Contributors

[![oooiik](https://avatars.githubusercontent.com/u/77920516?v=4)](https://github.com/oooiik "oooiik (21 commits)")

---

Tags

apilaraveldocumentationopenapiexportcollectiondeveloper-toolsPostman

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.8k14](/packages/api-platform-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[propaganistas/laravel-disposable-email

Disposable email validator

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

PHPackages © 2026

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