Sahil Rex
Sahil Rex

Reputation: 13

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 "L5Swagger\L5SwaggerServiceProvider"

Getting Error like:

enter image description here

Upvotes: 1

Views: 6553

Answers (1)

sid
sid

Reputation: 2037

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

Upvotes: 1

Related Questions