Swagger for Laravel
This package combines Swagger-php and swagger-ui into one Laravel-friendly package.
When you run your app in debug mode, Swaggervel 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 director.
Jlapp\Swaggervel\SwaggervelServiceProviderto your providers array in
php artisan swaggervel:installto push swagger-ui to your public folder.
php artisan config:publish jlapp/swaggervelto push config files to your app folder.
- www.example.com/docs <- swagger JSON files are visible
- www.example.com/api-docs <- swagger ui is visible.
Uncomment the "viewHeaders" option in the Config file to add headers to your view.
How to Use Swagger-php
The actual Swagger spec is beyond the scope of this package. All Swaggervel does is package up swagger-php and swagger-ui in a Laravel-friendly fashion, and tries to make it easy to serve. For info on how to use swagger-php look here. For good examples of swagger-php in action look here.
Log in or sign up for Devpost to join the conversation.