> ## 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.

# Introduction

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

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.

## What It Does

The package analyzes your Laravel application and produces documentation in three industry-standard formats:

<CardGroup cols={3}>
  <Card title="OpenAPI 3.0.3" icon="file-code">
    Generate JSON or YAML specifications compatible with Swagger UI, Redoc, and other OpenAPI tools
  </Card>

  <Card title="Postman Collection" icon="arrow-pointer">
    Create Postman Collection v2.1 files with auto-generated test scripts for API testing
  </Card>

  <Card title="Insomnia Workspace" icon="moon">
    Export Insomnia Workspace v4 files with organized environments and request collections
  </Card>
</CardGroup>

## 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

<CardGroup cols={2}>
  <Card title="Automatic Schema Generation" icon="wand-magic-sparkles">
    Extracts request/response schemas from FormRequests and Eloquent models without manual annotations
  </Card>

  <Card title="API Type Filtering" icon="filter">
    Generate separate documentation for admin, mobile, and public APIs using configurable route prefixes
  </Card>

  <Card title="Environment Management" icon="globe">
    Built-in support for multiple environments (local, staging, production) with hierarchical variable inheritance
  </Card>

  <Card title="Custom Templates" icon="file-lines">
    Override auto-generated docs with custom JSON templates for precise control over endpoint documentation
  </Card>

  <Card title="CRUD Test Generation" icon="vial">
    Automatically generates Postman test scripts that chain CRUD operations using variable tracking
  </Card>

  <Card title="Modular Architecture" icon="cubes">
    Full support for Nwidart Laravel Modules with per-module route organization
  </Card>
</CardGroup>

## How It Works

The package uses a three-phase approach:

<Steps>
  <Step title="Route Inspection">
    Scans your Laravel application routes and filters them by API type, prefix, and exclusion rules
  </Step>

  <Step title="Metadata Extraction">
    Analyzes FormRequests for validation rules, inspects Eloquent models for properties, and reads custom templates
  </Step>

  <Step title="Specification Generation">
    Builds OpenAPI, Postman, and Insomnia documents with complete request/response schemas, security definitions, and test scripts
  </Step>
</Steps>

## 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

<Info>
  This package supports Laravel 10.x, 11.x, and 12.x running on PHP 8.1 or higher.
</Info>

The package leverages Laravel's native route collection, FormRequest validation, and Eloquent model reflection APIs, ensuring compatibility with standard Laravel applications.

## Next Steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Install the package and publish configuration files
  </Card>

  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Generate your first API documentation in under 5 minutes
  </Card>
</CardGroup>
