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

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

luttamustache/op-laravel-swagger
================================

Fork from ronasit/laravel-swagger for old php versions (&lt;=7.2).

2.0.1(5y ago)0108MITPHPPHP &gt;=7.1.0

Since Apr 5Pushed 5y agoCompare

[ Source](https://github.com/LuttaMustache/op-laravel-swagger)[ Packagist](https://packagist.org/packages/luttamustache/op-laravel-swagger)[ RSS](/packages/luttamustache-op-laravel-swagger/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (29)Used By (0)

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

[](#laravel-op-autodoc-plugin)

This plugin is fork made from RonasIT/laravel-swagger to support old versions of PHP (&lt;=7.2).

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

[](#instalation)

### Composer

[](#composer)

1. `composer require luttamustache/op-laravel-swagger`

### Laravel

[](#laravel)

1. Add **LuttaMustache\\Support\\AutoDoc\\AutoDocServiceProvider::class** to providers in config/app.php
2. Add **\\RonasIT\\Support\\DataCollectors\\LocalDataCollectorServiceProvider::class** to providers in config/app.php
3. `php artisan vendor:publish`

### Plugin

[](#plugin)

1. Add middleware **\\LuttaMustache\\Support\\AutoDoc\\Http\\Middleware\\AutoDocMiddleware::class** to *Http/Kernel.php*.
2. Set **\\LuttaMustache\\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.

The plugin will automatically generate Swagger 2.0 documentation after you run phpunit.

Every phpunit execution rewrites the documentation file ***fully***. That means, if you want to maintain documentation full, you need to run phpunit on **every** test you have.

### Example

[](#example)

```
