New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

bchalier/laravel-openapi-autodoc

Automatic documentation of laravel in OpenApi format.
16,321 2
Install
composer require bchalier/laravel-openapi-autodoc
Latest Version:0.5.0
PHP:^8.1|^8.2|^8.3|^8.4
Laravel:10 – 13
Older releases:5 · 8 · 9
License:MIT
Last Updated:Oct 20, 2026
Links: GitHub  ·  Packagist
Maintainer: bchalier

Laravel OpenAPI Autodoc

Generates OpenAPI v3 documentation from your Laravel routes, FormRequests and API Resources.

Compatible with Laravel 10–12 and PHP 8.1–8.4.

Install

  1. Require the package in your app (Composer path repo supported):

  2. Publish the config if you need to customize:

php artisan vendor:publish --tag=config --provider="Bchalier\LaravelOpenapiDoc\App\Providers\LoadingServiceProvider"

Usage

  • Generate the JSON file:
    • php artisan documentation:generate
  • Output file:
    • Stored on the public disk at storage/app/public/documentation/openapi.json.
    • If you’ve run php artisan storage:link, it’s available at /storage/documentation/openapi.json.

How it works

  • Parses route list and filters via config/documentation.php.
  • Infers request schemas from FormRequest validation rules.
  • Infers response schemas from return types: JsonResource, ResourceCollection, JsonResponse.
  • Uses docblocks for operation summary/description and @throws to add error responses.

Notes

  • Models instantiated for resources must use Illuminate\Database\Eloquent\Factories\HasFactory.
  • When route names are missing, operationId falls back to <method>_<uri>.

Related Packages

ark4ne/laravel-openapi-generator

OpenApi - Laravel Documentation Generator

17,004 6
dedoc/scramble

Automatic generation of API documentation for Laravel applications.

18,869,591 2,218
justcoded/scramble

Automatic generation of API documentation for Laravel applications.

7,309 0
genericmilk/docudoodle

Generate documentation for your Laravel application using OpenAI

49,719 162
zquintana/lara-swag

Generates documentation for your REST API from annotations

2,401 1

Version History

Version Released PHP Laravel License
0.5.0 ^8.1|^8.2|^8.3|^8.4 ^10.0|^11.0|^12.0|^13.0 MIT
0.4.0 ^8.1|^8.2|^8.3|^8.4 ^10.0|^11.0|^12.0|^13.0 MIT
0.3.0 ^8.1|^8.2|^8.3|^8.4 ^10.0|^11.0|^12.0 MIT
0.2.2 ^8.1|^8.2|^8.3|^8.4 ^10.0|^11.0|^12.0 MIT
0.2.1 ^8.1|^8.2|^8.3|^8.4 ^10.0|^11.0|^12.0 MIT