Download the PHP package jobins/laravel-swagger-ui without Composer
On this page you can find all versions of the php package jobins/laravel-swagger-ui. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jobins/laravel-swagger-ui
More information about jobins/laravel-swagger-ui
Files in jobins/laravel-swagger-ui
Package laravel-swagger-ui
Short Description Add Swagger UI to a Laravel application.
License MIT
Homepage https://github.com/JoBinsJP/laravel-swagger-ui
Informations about the package laravel-swagger-ui
Laravel Swagger UI
This package makes it easy to make your project's Swagger (OpenAPI v3 JSON) file accessible in a Swagger UI right in your Laravel application.
The Swagger UI will automatically use your current project environment. It will set your api's base url to the active base url. Possible oauth2 configuration, such as urls and client-id/client-secret, can also be injected in Swagger UI via the configuration file.
Installation
You can install the package via composer:
After installing Laravel Swagger UI, publish its service provider and configuration file using the swagger-ui:install
Artisan command.
Usage
The Swagger UI is exposed at /swagger
. By default, you will only be able to access it in the local environment. Within your app/Providers/SwaggerUiServiceProvider.php
file, there is a gate
method. This authorization gate controls access to Swagger UI in non-local environments. You can modify this gate as needed to restrict access to your Swagger UI and Swagger (OpenAPI v3) file:
In the published config/swagger-ui.php
file, you edit the path to the Swagger UI and the location of the Swagger (OpenAPI v3) file. By default, the package expects to find the OpenAPI json file in 'resources/swagger' directory.
You also have the option to customize the oauth setup. By default, the oauth paths are configured based on Laravel Passport. You can also set a client ID and client secret. These values will be automatically prefilled in the authentication view in Swagger UI.
Testing
Linting
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Günther Debrauwer
- All Contributors
License
The MIT License (MIT). Please see License File for more information.