Download the PHP package ntgnn/swagger without Composer
On this page you can find all versions of the php package ntgnn/swagger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ntgnn/swagger
More information about ntgnn/swagger
Files in ntgnn/swagger
Informations about the package swagger
ntgnn/swagger
Yet another tool for documenting laravel-based APIs with OpenApi/Swagger. This package is highly inspired by great DarkaOnLine/L5-Swagger and also wraps zircote/swagger-php and swagger-api/swagger-ui, but since we had some particular requirements plus some issues when serving the static assets for swagger-ui, we decided do take a different approach. This package only supports OpenAPI annotations, Swagger 3.0, Laravel >=5.6.
To install this package in your laravel app, just use composer:
After the package is loaded, it will provide you with 3 console commands: init, generate-docs and copy-assets
Init: this command will setup the settings file (config/swagger.php) and create a folder for swagger-related files inside your app/Http. You should run this command only once per install.
Copy-Assets: this command with copy the swagger-ui related files to the public folder. You should run this command only once per install.
Generate-Docs: this command will scan your php files and generate the json specification file to be used by the swagger ui. The json file will be located inside the public folder. You should run this command every time you want to update the json file, for instance after annotating a controller.
Quick setup
- Go to an existing laravel app or create one
- Install the ntgnn/swagger package
- Run the init command
- Run the copy-assets command
- Run the generate-docs command
- Serve the app and browse the route /docs
All versions of swagger with dependencies
laravel/framework Version 5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
zircote/swagger-php Version ^3.0