Installation
Require the package
composer require ark4ne/laravel-openapi-generatorIt installs OpenAPI Writer, which writes the documents. The service provider is discovered by Laravel.
Publish the configuration
php artisan vendor:publish --tag=openapi-config
config/openapi.php is documented key by key; see the configuration reference.
It declares one document, v1, in OpenAPI 3.1.2, made of the routes under api/.
Generate the document
php artisan openapi:generate
The document is written on the default disk, in openapi/openapi-v1.json.
Check the installation
php artisan about
The OpenAPI Generator section shows the version of the package, the documents of the configuration and whether the JSON:API integration is enabled.
Optional dependencies
| Package | Adds |
|---|---|
opis/json-schema | Validation of every generated document against the official OpenAPI schemas. Recommended. |
symfony/yaml | Documents written as YAML (output.format, --format=yaml). |
ark4ne/laravel-json-api | JSON:API resources and requests documented as such: ^1.9, ^2.0 or ^3.0. See JSON:API. |
composer require --dev opis/json-schema
composer require symfony/yaml
Coding agents
Agents such as Claude Code or Cursor can load the skills shipped in
vendor/ark4ne/laravel-openapi-generator/skills/: laravel-openapi-generator (the rules, every attribute,
configuration key and extension point, tested recipes) and laravel-openapi-generator-upgrade (the migration from
0.6). See Agent skills.