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

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

dannecron/laravel-swagger
=========================

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

1.4.0(7y ago)07.7kMITPHPPHP &gt;=7.1

Since Apr 5Pushed 7y ago2 watchersCompare

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

READMEChangelogDependencies (2)Versions (21)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.

Instalation
-----------

[](#instalation)

### Composer

[](#composer)

1. `composer require ronasit/laravel-swagger`

### Laravel

[](#laravel)

1. `php artisan vendor:publish`

### Plugin

[](#plugin)

1. Add middleware **\\RonasIT\\Support\\AutoDoc\\Http\\Middleware\\AutoDocMiddleware::class** to *Http/Kernel.php*.
2. Set **\\RonasIT\\Support\\AutoDoc\\Tests\\AutoDocTestCase** as parent of 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)

```
