我还在我的 env 中设置了php composer require "darkaonline/l5-swagger:5.6.*"
php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"
并创建了一个控制器并添加了相关内容。L5_SWAGGER_GENERATE_ALWAYS=true
/**
* @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="contact@mysite.com"
* ),
* @SWG\License(
* name="Private License",
* url="URL to the license"
* )
* ),
* @SWG\ExternalDocumentation(
* description="Find out more about my website",
* url="http..."
* )
* )
*/
之后我输入了
php artisan l5-swagger:generate
php artisan vendor:publish
当我访问/api/documentation时,我得到一个白屏,在控制台中我得到以下错误。
您的帮助将不胜感激。