PHPackages                             asxer/laravel-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. asxer/laravel-swagger

Abandoned → [asxer/laravel-swagger](/?search=asxer%2Flaravel-swagger)Library[Testing &amp; Quality](/categories/testing)

asxer/laravel-swagger
=====================

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

1.5.1(5y ago)031MITPHPPHP &gt;=7.1.0

Since Apr 5Pushed 5y agoCompare

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

READMEChangelogDependencies (2)Versions (32)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 asxer/laravel-swagger`

### Laravel

[](#laravel)

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

### Plugin

[](#plugin)

1. Add middleware **\\Asxer\\Support\\AutoDoc\\Http\\Middleware\\AutoDocMiddleware::class** to *Http/Kernel.php*.
2. Use **\\Asxer\\Support\\AutoDoc\\Tests\\AutoDocTestCaseTrait** in your TestCase in *tests/TestCase.php*
3. In *config/auto-doc.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. In annotation of custom request you can specify summary and description of this request. Plugin will take validation rules from your request and use it as description of input parameter.

### Example

[](#example)

```
