liucg1995/laravel-apidoc

1.0.1 2021-08-12 13:58 UTC

This package is not auto-updated.

Last update: 2024-11-16 03:47:26 UTC


README

安装

$ composer require liucg1995/laravel-apidoc

添加 service provider ( laravel<5 )

Liucg1995\Apidoc\ApidocServiceProvider::class

配置文件

$ php artisan vendor:publish --provider="Liucg1995\Apidoc\ApidocServiceProvider"

安装Apidoc

$ npm install apidoc -g

调试加入Apidoc中间件

Liucg1995\Apidoc\Middleware\ApiDoc::class

接口请求生成文档

在header请求中增加三个参数

  • createDoc 创建Apidoc文档
  • apiname 接口名称
  • apidescription 接口介绍

Header-Example:

{
    "apidescription":"apidescription",
    "apiname":"apiname",
    "createDoc":1
}

手动生成文档

$ php artisan apidoc:generate

Apidoc文档目录

/storage/framework/apidoc