PHPackages                             tenantcloud/laravel-auto-generate-swagger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. tenantcloud/laravel-auto-generate-swagger

ActiveLibrary[Testing &amp; Quality](/categories/testing)

tenantcloud/laravel-auto-generate-swagger
=========================================

Provided middleware for generating of swagger-documentation file by run testing of RESTful API.

v1.6.2(9mo ago)128.4k↓25.3%2MITPHPPHP &gt;=7.1.0

Since Apr 5Pushed 9mo agoCompare

[ Source](https://github.com/tenantcloud/laravel-auto-generate-swagger)[ Packagist](https://packagist.org/packages/tenantcloud/laravel-auto-generate-swagger)[ RSS](/packages/tenantcloud-laravel-auto-generate-swagger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)DependenciesVersions (54)Used By (0)

Laravel AutoDoc plugin
======================

[](#laravel-autodoc-plugin)

This plugin is designed to gather information and generate documentation about your Rest-Api while passing the tests. The principle of operation is based on the fact that the special Middleware installed on the Route for which you want to collect information that after the successful completion of all tests generated Swagger-file. In addition this plug-in is able to draw Swagger-template to display the generated documentation for a config.

Installation
------------

[](#installation)

### Composer

[](#composer)

1. `composer require tenantcloud/laravel-auto-generate-swagger`

### Laravel

[](#laravel)

1. add `RonasIT\Support\AutoDoc\AutoDocServiceProvider::class,` to providers in `config/app.php`
2. run `php artisan vendor:publish`

### Plugin

[](#plugin)

1. Add middleware **\\RonasIT\\Support\\AutoDoc\\Http\\Middleware\\AutoDocMiddleware::class** to *Http/Kernel.php*.
2. Use **\\RonasIT\\Support\\AutoDoc\\Tests\\AutoDocTestCaseTrait** in your TestCase in *tests/TestCase.php*
3. In *config/swagger.php* you can specify enabling of plugin, info of your project, some defaults descriptions and route for rendering of documentation.
4. In *.env* file you should add following lines `LOCAL_DATA_COLLECTOR_PROD_PATH=/example-folder/documentation.json   LOCAL_DATA_COLLECTOR_TEMP_PATH=/tmp/documentation.json`

Usages
------

[](#usages)

For correct working of plugin you have to dispose all the validation rules in the rules() method of class YourRequest, which must be connected to the controller via DependencyInjection. Plugin will take validation rules from your request and use it as description of input parameter.

### Example

[](#example)

```
