Skip to content
Advertisement

How to Install Swagger to Laravel 8 API for documentation?

Installing Swagger for the First Time in laravel 8

composer require "darkaonline/l5-swagger"
composer require zircote/swagger-php
php artisan vendor:publish --provider "L5SwaggerL5SwaggerServiceProvider"

Getting Error like:

enter image description here

Advertisement

Answer

I’m guessing the URL you’re hitting might be incorrect. Change it to just docs/api-docs instead of docs/api-docs.json. In addition, if you haven’t ran the generate command already, you would have to do so to make it work.

php artisan l5-swagger:generate
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement