定制 dwolf555/api-docs-controller 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dwolf555/api-docs-controller

Composer 安装命令:

composer require dwolf555/api-docs-controller

包简介

README 文档

README

Laravel controller class that allows for output of API docs if the "accept" header is not set to json.

Set up

Add the following to your composer.json and composer update / composer install

{
    "require": {
        "dwolf555/api-docs-controller": "dev-master"
    }
}

Add the following to your app/config/app.php providers array

'Dwolf555\ApiDocsController\ApiDocsControllerServiceProvider',

Example Controller

class UserController extends Dwolf555\ApiDocsController\ApiDocsController {

    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
        // For documentation
        $this->apiDocInfo = [
            'wordOfWarning' => 'Just be ok, ok?',
            'exampleResponse' => ['message' => 'ok'],
            'inputs' => [
                'limit' => 10,
                'offset' => 0
            ],
            'possibleErrors' => [
                'limit' => 'Limit must be a valid integer.',
                'offset' => 'Limit must be a valid integer.',
            ]
        ];

        $content = array(
            'actualcontent' => 'realstuff'
        );
        $statusCode = 200;

        return $this->generateResponse($content, $statusCode);
    }

}

Example Output

Example Output

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-01-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固