A great way to integrate Swagger into 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., (*1)
composer require appointer/swaggervel --devwithin your laravel root directory
Appointer\Swaggervel\SwaggervelServiceProvider::classto your providers array in
app/config/app.phpabove your route provider, to avoid any catch-all routes
php artisan vendor:publish --tag=publicto push swagger-ui to your public folder (can be found in public/vendor/swaggervel).
php artisan vendor:publish --tag=configto push the swaggervel default config into your application's config directory.
php artisan vendor:publish --tag=viewsto push the swaggervel index view file into
All options are well commented within the swaggervel.php config file., (*2)
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., (*3)
This package is a fork of slampenny/Swaggervel, as it is no longer maintained., (*4)