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.
Requirements
Before installing, ensure your environment meets these requirements:| Component | Version |
|---|---|
| PHP | 8.1+ |
| Laravel | 10.x, 11.x, or 12.x |
| Composer | 2.x |
The package requires
illuminate/support, illuminate/console, and illuminate/routing packages, which are included in standard Laravel installations.Install via Composer
Require the package
Install the package using Composer:The service provider and facade are automatically discovered via Laravel’s package auto-discovery feature defined in
composer.json.Publish Configuration Files
Publishing configuration files is highly recommended to customize API metadata, environments, and output settings.
Publish All Configuration Files
Run this command to publish all configuration files:config/ directory:
Configuration File Purposes
openapi.php
Main configuration file for API metadata, servers, security schemes, API types, and output paths
openapi-docs.php
Custom endpoint documentation and resource-specific descriptions that override auto-generated content
openapi-tests.php
Settings for Postman test script generation including assertions and variable tracking
openapi-templates.php
Path configuration for custom JSON templates used to document specific endpoints
Publish Templates (Optional)
If you want to customize endpoint documentation using JSON templates, publish the template directory:Essential Configuration
After publishing, configure these essential settings inconfig/openapi.php:
1. API Information
Update the API metadata to match your application:config/openapi.php
2. API Servers
Define the environments where your API is accessible:config/openapi.php
3. API Types
Configure route prefixes for different API surfaces:config/openapi.php
4. Security Schemes
Define authentication methods for your API:config/openapi.php
5. Route Exclusions
Exclude internal or framework routes from documentation:config/openapi.php
Enable HTTP Documentation Routes
To serve documentation via HTTP endpoints, ensure routes are enabled:config/openapi.php
http://localhost:8000/documentation/openapi.jsonhttp://localhost:8000/documentation/openapi.yamlhttp://localhost:8000/documentation/postmanhttp://localhost:8000/documentation/insomnia
Environment Variables
For sensitive or environment-specific settings, use.env variables:
.env
Optional: Modular Architecture Support
If you use Nwidart Laravel Modules, configure the modules path:config/openapi.php
{module} placeholder is automatically replaced with actual module names during generation.
Verify Installation
Test the installation by generating documentation:storage/app/public/openapi/).
Next Steps
Quick Start Guide
Generate your first complete API documentation with a step-by-step tutorial