Laravel OpenAPI Generator is a powerful Laravel package that automatically generates comprehensive API documentation by inspecting your application’s routes, FormRequest validation rules, and model metadata.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/charlietyn/openapi-generator/llms.txt
Use this file to discover all available pages before exploring further.
What It Does
The package analyzes your Laravel application and produces documentation in three industry-standard formats:OpenAPI 3.0.3
Generate JSON or YAML specifications compatible with Swagger UI, Redoc, and other OpenAPI tools
Postman Collection
Create Postman Collection v2.1 files with auto-generated test scripts for API testing
Insomnia Workspace
Export Insomnia Workspace v4 files with organized environments and request collections
Why Use Laravel OpenAPI Generator?
Zero Manual Documentation
Instead of manually writing and maintaining API documentation that quickly becomes outdated, this package generates documentation directly from your code. When your routes, validation rules, or models change, regenerate the docs and they’re instantly up to date.Multi-Format Export
Generate documentation in the format your team needs:- Developers can import OpenAPI specs into Swagger UI or API testing tools
- QA teams can load Postman collections with pre-configured test scripts
- Mobile developers can use Insomnia workspaces for rapid API exploration
Multi-API Support
Organize your documentation by API type (admin, mobile, public) with separate specifications for different audiences. Each API type can have its own prefix, middleware, and documentation structure.Smart Metadata Extraction
The generator automatically infers:- Request schemas from FormRequest validation rules
- Response structures from model properties and relationships
- Authentication requirements from route middleware
- Path parameters, query strings, and request bodies
Key Features
Automatic Schema Generation
Extracts request/response schemas from FormRequests and Eloquent models without manual annotations
API Type Filtering
Generate separate documentation for admin, mobile, and public APIs using configurable route prefixes
Environment Management
Built-in support for multiple environments (local, staging, production) with hierarchical variable inheritance
Custom Templates
Override auto-generated docs with custom JSON templates for precise control over endpoint documentation
CRUD Test Generation
Automatically generates Postman test scripts that chain CRUD operations using variable tracking
Modular Architecture
Full support for Nwidart Laravel Modules with per-module route organization
How It Works
The package uses a three-phase approach:Route Inspection
Scans your Laravel application routes and filters them by API type, prefix, and exclusion rules
Metadata Extraction
Analyzes FormRequests for validation rules, inspects Eloquent models for properties, and reads custom templates
Common Use Cases
Team Collaboration
Share consistent, always-up-to-date API documentation with frontend developers, mobile teams, and QA engineers. Export Postman collections for immediate testing or OpenAPI specs for contract validation.API Versioning
Generate separate documentation for different API versions by configuring multiple API types with version-specific route prefixes.CI/CD Integration
Integrate the generator into your deployment pipeline to automatically publish documentation artifacts whenever your API changes.Multi-Tenant Applications
Document different API surfaces for different user roles (admin, customer, partner) using API type filtering.Supported Laravel Versions
This package supports Laravel 10.x, 11.x, and 12.x running on PHP 8.1 or higher.
Next Steps
Installation
Install the package and publish configuration files
Quick Start
Generate your first API documentation in under 5 minutes