PHPackages                             dogukantokgoz/route-to-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. dogukantokgoz/route-to-postman

ActiveLibrary[API Development](/categories/api)

dogukantokgoz/route-to-postman
==============================

Generate Postman collections directly from Laravel routes with structured grouping and documentation.

v1.1.0(5mo ago)438—0%MITPHPPHP ^8.1

Since Dec 2Pushed 5mo agoCompare

[ Source](https://github.com/dogukantokgoz/route2postman)[ Packagist](https://packagist.org/packages/dogukantokgoz/route-to-postman)[ RSS](/packages/dogukantokgoz-route-to-postman/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Route to Postman for Laravel
============================

[](#route-to-postman-for-laravel)

[![Latest Version](https://camo.githubusercontent.com/1fe4accef2ba4118529b31c3f6ef7e47615ff848c62fef69cdf98ffa5f14dbe0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f67756b616e746f6b676f7a2f726f7574652d746f2d706f73746d616e2e7376673f7374796c653d666c61742d737175617265266c6162656c3d5061636b61676525323056657273696f6e)](https://packagist.org/packages/dogukantokgoz/route-to-postman)

Generate organized Postman collections directly from your Laravel routes with intelligent automation.

[![Route to Postman](https://camo.githubusercontent.com/166a7b775e7afd3205f000fb3f81da11f4abb51df3df2a5f61c5ab4a7b22c306/68747470733a2f2f692e696d6775722e636f6d2f686577545231492e706e67)](https://camo.githubusercontent.com/166a7b775e7afd3205f000fb3f81da11f4abb51df3df2a5f61c5ab4a7b22c306/68747470733a2f2f692e696d6775722e636f6d2f686577545231492e706e67)

Features
--------

[](#features)

### 📂 Smart File Structure

[](#-smart-file-structure)

The package automatically organizes your Postman collection based on your route prefixes.

- **Folders:** Created based on the route prefix (e.g., `api/users` -&gt; `users` folder).
- **Requests:** Named using the controller method in PascalCase (e.g., `UserController@store` -&gt; `Store`).
- **Filtering:** Routes defined in `routes/api.php` that do not have a valid controller method are automatically skipped to keep your collection clean.

### 📝 Intelligent Body Generation

[](#-intelligent-body-generation)

The package analyzes your code to generate sample request bodies for `POST`, `PUT`, and `PATCH` requests.

1. **FormRequest:** If a method uses a `FormRequest`, validation rules are used to generate the body.
2. **Model Inference:** If no `FormRequest` is used, the package infers the Model from the Controller name (e.g., `ProductController` -&gt; `Product` model). It then uses the model's `fillable` attributes to generate the request body.

### 🔐 Automated Authentication

[](#-automated-authentication)

Forget about manually copying and pasting tokens!

1. **Login Detection:** The package automatically finds routes ending in `login` or containing `auth/login`.
2. **Auto-Script Injection:** A Postman test script is injected into the login request to capture the token.
3. **Smart Bearer Token Assignment:** Bearer token is automatically added to routes that have middleware assigned. Public routes (without middleware) and excluded routes will not receive bearer token authentication.

**Expected Login Response:**The script expects the token to be in `data.token`. Example:

```
{
    "success": true,
    "message": "Login successful",
    "data": {
        "token": "your_generated_token_here"
    }
}
```

*Once you run the Login request in Postman, the token is automatically saved and used for all other requests.*

**Bearer Token Rules:**

- ✅ **Added to:** Routes with any middleware (except `api` middleware which is automatically added by Laravel)
- ❌ **Not added to:**
    - Routes without middleware (public routes)
    - Routes matching patterns in `excluded_routes` config (login, register, password reset, email verification, etc.)

**Excluded Routes Configuration:**You can configure which routes should not receive bearer token in `config/postman.php`:

```
'excluded_routes' => [
    // Authentication routes
    'login',
    'register',
    'auth/google',
    'auth/facebook',

    // Password reset routes
    'password-reset',
    'password/reset',
    'password/email',
    '/password/reset',
    'forgot-password',
    'forgotpassword',
    'reset-password',
    'resetpassword',

    // Email verification routes
    'email/verify',
    'email/resend',
    '/email/verify',
    '/email/resend',
],
```

### ⚙️ Configuration

[](#️-configuration)

- **Collection Name:** The Postman collection name is taken from your `APP_NAME` environment variable (defaults to 'Laravel Routes').

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

[](#installation)

```
composer require dogukantokgoz/route-to-postman
```

Publish the configuration file:

```
php artisan vendor:publish --provider="dogukantokgoz\Route2Postman\PostmanServiceProvider" --tag=postman-config
```

Usage
-----

[](#usage)

Run the command to generate your collection:

```
php artisan route:export
```

The collection will be saved to `storage/postman/route_collection.json`. Import this file into Postman.

License
-------

[](#license)

[MIT](./LICENSE)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance72

Regular maintenance activity

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

3

Last Release

160d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13cb5217fbaeaf6439388f43a8e34fe434fa39d737a51231bfe3318b1217c152?d=identicon)[dogukantokgoz](/maintainers/dogukantokgoz)

---

Top Contributors

[![dogukantokgoz](https://avatars.githubusercontent.com/u/34275566?v=4)](https://github.com/dogukantokgoz "dogukantokgoz (8 commits)")

### Embed Badge

![Health badge](/badges/dogukantokgoz-route-to-postman/health.svg)

```
[![Health](https://phpackages.com/badges/dogukantokgoz-route-to-postman/health.svg)](https://phpackages.com/packages/dogukantokgoz-route-to-postman)
```

###  Alternatives

[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[worksome/graphlint

A static analysis tool for GraphQL

13189.4k](/packages/worksome-graphlint)[esign/laravel-conversions-api

A laravel wrapper package around the Facebook Conversions API

69145.4k](/packages/esign-laravel-conversions-api)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[didww/didww-api-3-php-sdk

PHP SDK for DIDWW API 3

1218.2k](/packages/didww-didww-api-3-php-sdk)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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