Download the PHP package solomon04/documentation without Composer
On this page you can find all versions of the php package solomon04/documentation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download solomon04/documentation
More information about solomon04/documentation
Files in solomon04/documentation
Package documentation
Short Description Generate API Documentation for your Laravel applications using annotations & LaRecipe.
License MIT
Informations about the package documentation
Laravel REST API Documenter
Generate Documentation for your REST API
This package allows you to generate documentation for your REST API via annotations. The markdown is then served by LaRecipe to generate beautiful documentation for your API.
Note this package is NOT stable. I've used it for only one of my repo's.
Getting Started
Install LaRecipe
It is mandatory you install the LaRecipe package in order to get the benefits of the API documenter.
Install LaRecipe via composer.
composer require binarytorch/larecipe
Run the install command.
php artisan larecipe:install
Install Documenter
Install Documenter via composer
composer require solomon04/documentation
Publish provider
php artisan vendor:publish --provider="Solomon04\Documentation\DocumentationServiceProvider"
Steps
- Go to an API controller
- Add available annotations to the file.
- Run
php artisan docs:generate
Available Annotations:
@Group
The group annotation is used to group endpoints within a single controller class.
Attributes
- Name (required)
- Description (optional)
Example
@Meta
The meta annotation is used to document a single endpoint. This would be a function within a controller class.
Attributes
- Name (required)
- Href (required)
- Description (optional)
Example
@BodyParam
The body param annotation is used to document the available body parameters within a single endpoint request.
Attributes
- Name (required)
- Type (required)
- Status (required)
- Description (optional)
- Example (optional)
Example
@QueryParam
The query param annotation is used to document the available query parameters within a single endpoint request.
Attributes
- Name (required)
- Type (required)
- Status (required)
- Description (optional)
- Example (optional)
Example
@ResponseExample
The response example annotation is used to give an example response for an endpoint.
Important Note: Response example file must be stored in the storage/
directory.
Attributes
- Status (required)
- Example (required)
Example
Demo Laravel App
View an example of documentation using the Laravel REST API Documenter.
Tutorial
View a video tutorial here