Skip to content

emirhg/swaggervel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swaggervel (Swagger integration for Laravel 5)

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.

Installation

  • Execute composer require "appointer/Swaggervel" --dev within your laravel root directory
  • Add Jlapp\Swaggervel\SwaggervelServiceProvider::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 to push swagger-ui to your public folder (can be found in public/vendor/swaggervel).

Example

Options

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.

Examples

To provide a better introduction into actually using swaggervel with laravel, we attached several examples in the examples-folder within the project. Be aware, that these are only recommendations and created by our own uses and knowledge - if you have any ideas on how to improve, please let us know!

Further Notes

This package is a fork of slampenny/Swaggervel, as it is no longer maintained.

About

Swagger for Laravel

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 72.0%
  • HTML 28.0%