PHPackages                             ronu/laravel-openapi-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. ronu/laravel-openapi-generator

ActiveLibrary[API Development](/categories/api)

ronu/laravel-openapi-generator
==============================

Automatic OpenAPI 3.0.3 documentation generator for Laravel with Postman and Insomnia export support

1.2.6(3mo ago)266MITPHPPHP ^8.1|^8.2|^8.3

Since Jan 12Pushed 3mo agoCompare

[ Source](https://github.com/charlietyn/openapi-generator)[ Packagist](https://packagist.org/packages/ronu/laravel-openapi-generator)[ RSS](/packages/ronu-laravel-openapi-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (46)Used By (0)

Laravel OpenAPI Generator
=========================

[](#laravel-openapi-generator)

Automatic OpenAPI 3.0.3, Postman, and Insomnia documentation generation for Laravel applications.

 [![Latest Version](https://camo.githubusercontent.com/8e6d1309d3946f514744325433edcdcc81d90f2efab46431a2a888930f50e9eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6e752f6c61726176656c2d6f70656e6170692d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/8e6d1309d3946f514744325433edcdcc81d90f2efab46431a2a888930f50e9eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6e752f6c61726176656c2d6f70656e6170692d67656e657261746f722e7376673f7374796c653d666c61742d737175617265) [![Total Downloads](https://camo.githubusercontent.com/beccb0630a6ee2fcd7bb4268b99825707a84e9e538cca98a06237232b33d0666/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6e752f6c61726176656c2d6f70656e6170692d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/beccb0630a6ee2fcd7bb4268b99825707a84e9e538cca98a06237232b33d0666/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6e752f6c61726176656c2d6f70656e6170692d67656e657261746f722e7376673f7374796c653d666c61742d737175617265) [![License](https://camo.githubusercontent.com/82b7e9c6130c0c33fde232d98e258494d4ca5d43178554131b18c77ab77f9b06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726f6e752f6c61726176656c2d6f70656e6170692d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/82b7e9c6130c0c33fde232d98e258494d4ca5d43178554131b18c77ab77f9b06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726f6e752f6c61726176656c2d6f70656e6170692d67656e657261746f722e7376673f7374796c653d666c61742d737175617265) [![Laravel](https://camo.githubusercontent.com/f002ff4a2256ffcb0be8275519086e42196dae3482e3d466f7f04d7678ab005a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253230253743253230313125323025374325323031322d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://camo.githubusercontent.com/f002ff4a2256ffcb0be8275519086e42196dae3482e3d466f7f04d7678ab005a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3130253230253743253230313125323025374325323031322d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c) [![PHP](https://camo.githubusercontent.com/43a52de372d08e615769aeeed8ba305d51236062c2f310351a08c9805d833f33/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://camo.githubusercontent.com/43a52de372d08e615769aeeed8ba305d51236062c2f310351a08c9805d833f33/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870)

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

[](#requirements)

- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x
- Composer 2.x

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

[](#installation)

```
composer require ronu/laravel-openapi-generator
```

Publish configuration (recommended):

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

Publish templates (optional):

```
php artisan vendor:publish --tag=openapi-templates
```

Quickstart
----------

[](#quickstart)

Generate OpenAPI JSON:

```
php artisan openapi:generate
```

Generate all formats:

```
php artisan openapi:generate --all
```

Fetch via HTTP (when routes are enabled):

```
curl http://localhost:8000/documentation/openapi.json
curl http://localhost:8000/documentation/postman
curl http://localhost:8000/documentation/insomnia
```

Minimum viable configuration
----------------------------

[](#minimum-viable-configuration)

The package works out-of-the-box, but most teams configure API types and routes in `config/openapi.php`:

```
return [
    'api_types' => [
        'admin' => [
            'prefix' => 'admin',
            'folder_name' => 'API Admin',
            'enabled' => true,
        ],
        'mobile' => [
            'prefix' => 'mobile',
            'folder_name' => 'API Mobile',
            'enabled' => true,
        ],
    ],
    'routes' => [
        'enabled' => true,
        'prefix' => 'documentation',
        'middleware' => [],
    ],
];
```

Common scenarios
----------------

[](#common-scenarios)

### 1) Filter docs by API type

[](#1-filter-docs-by-api-type)

```
php artisan openapi:generate --all --api-type=admin --api-type=mobile
```

### 2) Expose documentation via HTTP

[](#2-expose-documentation-via-http)

```
curl "http://localhost:8000/documentation/openapi.json?api_type=admin,mobile"
```

### 3) Add custom endpoint docs

[](#3-add-custom-endpoint-docs)

```
// config/openapi-docs.php
'custom_endpoints' => [
    'api-apps.rotate' => [
        'summary' => 'Rotate API Key',
        'description' => 'Generates a new API key for the application.',
        'request_fields' => [
            'reason' => 'Optional reason for key rotation',
        ],
    ],
],
```

Edge scenarios (short list)
---------------------------

[](#edge-scenarios-short-list)

- Config caching + runtime `env()` usage can keep old values; prefer config overrides and clear cache.
- Concurrent generation can write to the same output files; use `--output` for unique paths.
- Large route sets may time out on HTTP endpoints; generate via CLI and serve files from storage.

See [Edge and extreme scenarios](documentation/03-usage/03-edge-and-extreme-scenarios.md) for details.

API reference
-------------

[](#api-reference)

- [Public API](documentation/04-reference/00-public-api.md)
- [Artisan command reference](documentation/04-reference/01-artisan-commands.md)

Troubleshooting (quick)
-----------------------

[](#troubleshooting-quick)

- **Invalid api\_type**: Check `openapi.api_types` and ensure the key is enabled.
- **No routes found**: Review `openapi.exclude_routes` and API type filters.
- **Placeholders not updating**: Clear config cache or set config values explicitly.

Full documentation
------------------

[](#full-documentation)

Start here: **[documentation/index.md](documentation/index.md)**

Contributing &amp; security
---------------------------

[](#contributing--security)

- Contributing guide: open a PR with clear scope and tests when possible.
- Security: please report vulnerabilities privately to the maintainers.

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance81

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 91.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 ~1 days

Total

22

Last Release

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f59437a00cb4187df5eeb376f1c72053def2a2b16227a1e70d0c48ab2c99a4e?d=identicon)[charlietyn](/maintainers/charlietyn)

---

Top Contributors

[![charlietyn](https://avatars.githubusercontent.com/u/10063918?v=4)](https://github.com/charlietyn "charlietyn (91 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (8 commits)")

---

Tags

laravelswaggeropenapiREST APIPostmanDocumentation generatorapi-documentationinsomnia

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ronu-laravel-openapi-generator/health.svg)

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

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.1M5](/packages/kirschbaum-development-laravel-openapi-validator)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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