from Lithium Hosting
We're always open to pull requests, feel free to make this your own or help us make it better.
(c) Lithium Hosting, llc
This library is licensed under the MIT license; you can find a full copy of the license itself in the file /LICENSE
Inspired by Jordan Lapp's Swaggervel!
PHP 5.5.9 or newer
This package combines Swagger-php and swagger-ui into one Laravel-friendly package.
When you run your app in debug mode, L5-Swagger will scan your app folder (or any folder that is set under the "app-dir" variable in the packages config), generate swagger json files and deposit them to the doc-dir folder (default is /docs). Files are then served by swagger-ui under the api-docs directory.
Installation is easy, just add "lithiumdev/l5-swagger": "~1.0" to your composer.json and then run composer update
You can also just type composer require lithiumdev/l5-swagger:~1.0.
After the composer install finishes, register the service provider and publish the assets:
Add LithiumDev\Swagger\SwaggerServiceProvider::class, to your providers array in app/config/app.php above your route provider, to avoid any catch-all routes
Run php artisan vendor:publish --provider="LithiumDev\Swagger\SwaggerServiceProvider" to publish required resources.
Two routes are available, one serves the swagger JSON file and the other displays Swagger-UI