i have installed laravel 5.6 with Swagger with DarkaOnLine/L5-Swagger package, i have followed the installation instructions that is
php composer require "darkaonline/l5-swagger:5.6.*"
php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"
i have also set
L5_SWAGGER_GENERATE_ALWAYS=true
in my env and created a controller and added
/**
* @SWG\Swagger(
* schemes={"http","https"},
* host="api.host.com",
* basePath="/",
* @SWG\Info(
* version="1.0.0",
* title="This is my website cool API",
* description="Api description...",
* termsOfService="",
* @SWG\Contact(
* email="[email protected]"
* ),
* @SWG\License(
* name="Private License",
* url="URL to the license"
* )
* ),
* @SWG\ExternalDocumentation(
* description="Find out more about my website",
* url="http..."
* )
* )
*/
after that i typed
php artisan l5-swagger:generate
php artisan vendor:publish
when i visit /api/documentation i get a white screen and in the console i am getting the following error
your help will be highly appreciated.
I have fixed that issue by steps:
just copied files from vendor folder and added in the specific path.
Copy all the files from : laravel-yourapp\vendor\swagger-api\swagger-ui\dist
Then paste all files in path: laravel-yourapp\public\docs\asset
1 - try to copy the /dist
directory in \vendor\swagger-api\swagger-ui
to \public_html\swagger-api\
2 - change "swagger_ui_assets_path"
address from \config\l5-swagger.php
to 'public_html\swagger-api\'
3 - change all links in link and script tag in view file \resources\views\vendor\l5-swagger\index.blade.php
4- type command php artisan l5-swagger:generate
or add L5_SWAGGER_GENERATE_ALWAYS=true
in .env file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With