421c / autodoc-laravel
Automatic API documentation generation tool for Laravel projects
Installs: 233
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/421c/autodoc-laravel
Requires
- 421c/autodoc-php: ^1.12.2
- illuminate/database: ^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0
- illuminate/routing: ^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0
- illuminate/support: ^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- larastan/larastan: ^3.0
- orchestra/testbench: ^9.5
- phpunit/phpunit: ^11.4
- symfony/var-dumper: ^7.1
README
This is a Laravel integration of PHP autodoc.
PHP autodoc automatically generates up-to-date OpenAPI 3.1.0 documentation and TypeScript types directly from your PHP code – no PHPDoc annotations required.
Instead of relying on manually written comments, PHP autodoc reads your actual PHP code and native types to extract accurate type information. PHPDoc annotations are supported if present, but completely optional.
This package provides seamless integration with Laravel routes, request validation, query builder, database models, API resources, and more.
Visit phpautodoc.com to see full documentation.
Installation
To install PHP autodoc in a Laravel project, simply install the 421c/autodoc-laravel package.
composer require 421c/autodoc-laravel
Then copy configuration file to your project using the command below.
php artisan vendor:publish --provider="AutoDoc\Laravel\Providers\AutoDocServiceProvider"
Open your config/autodoc.php file and set openapi_export_dir setting to a directory where you want to save OpenApi 3.1.0 schema JSON files generated by this package.
Make sure this directory exists and is writable.
In your configuration file you can also specify URL to your API docs page with laravel.url setting.
If you left it unchanged, you can visit /api-docs route to see the generated documentation.
To improve the generated documentation, see tips to improve the generated documentation.