Download the PHP package mindedge/laravel-api-doc without Composer
On this page you can find all versions of the php package mindedge/laravel-api-doc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mindedge/laravel-api-doc
More information about mindedge/laravel-api-doc
Files in mindedge/laravel-api-doc
Package laravel-api-doc
Short Description Automatically parse laravel api routes and store them in an OpenAPI compatible format
License MIT
Informations about the package laravel-api-doc
Laravel-Api-Doc
Automatically create documentation for Laravel api's off the registered routes and PHPDoc comments
Table of Contents
- Installation
- How it works
- Usage
- Advanced Usage
- License
Installation
You can install the package via composer:
How it works
Take the below example route url and controller method:
POST Request: /1.0/pages/1234/posts
This library will scan the registered Laravel routes, and see that /1.0/pages/1234/posts
is registered to PostController@create
.
It will then scan the create
method definition for route parameters. This is so we always grab the true parameter list even if the PHPDoc comments don't include them.
If the first parameter is an instance of Illuminate\Foundation\Http\FormRequest
we will scan the class for a rules()
method to build a list of the form/query parameters.
The we will continue parsing the controller create
method to get the route parameters. In this example we have $page_id
so we will check the PHPDoc comments to grab a description of what this parameter does.
Usage
Basic Usage:
Get the routes as an OpenApi json object:
Get the routes as an OpenApi php array:
Advanced Usage
You can supply a partially pre-filled document to Doc::generate()
to set default values
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-api-doc with dependencies
goldspecdigital/laravel-eloquent-uuid Version ^10.0
symfony/yaml Version ^6