ycpfzf/apidoc
Composer 安装命令:
composer require ycpfzf/apidoc
包简介
laravel api doc
README 文档
README
This is an automatic API interface document generation tool based on laravel.
Requirements
- PHP >= 7.0.0
- Laravel >= 5.5.0
- Fileinfo PHP Extension
Installation
First
composer require ycpfzf/apidoc
Then run these commands to publish assets and config:
php artisan vendor:publish --provider="Ycpfzf\Apidoc\DocServiceProvider"
Config
The file config/admin.php contains an array of configurations, you can find the default configurations in there.
'controller' => [
'App\Http\Controllers\Api\Index'
],
Use
Add comments to the controller class, for example:
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
/**
* @title 用户
* @description 用户信息
* @group 公共分组
* @header name:Authorization require:1 default: desc:Token
*
*/
class Index extends Controller
{
/**
* @title 用户信息
* @description 获取用户的基本信息
* @author fzf
* @url /api/user
* @method get
* @param name:page type:string require:0 default:1 other: desc:当前页
* @param name:num type:string require:0 default:10 other: desc:每页记录数
* @return token:名称
*/
function index(){
return [
'status_code'=>200,
'message'=>'success',
'data'=>null,
'time'=>time(),
];
}
}
Open the http://your-url/doc to view the API documentation
Security Vulnerabilities
If you discover a security vulnerability, please send an email ysfzf@hotmail.com. All security vulnerabilities will be promptly addressed.
License
The APIDOC is open-sourced software licensed under the MIT license.
ycpfzf/apidoc 适用场景与选型建议
ycpfzf/apidoc 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 248 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 06 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「doc」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ycpfzf/apidoc 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ycpfzf/apidoc 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ycpfzf/apidoc 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
A tool for display docs or api docs to others
Alfabank REST API integration
swagger component for swoft
[重大更新!]适合中小型公司使用.可作为调试工具(postman),可作为文档.简单配置,不切入系统.一切以提高开发效率,提高生产力为基准
Fork de PHPWord (http://phpoffice.github.io)
统计信息
- 总下载量: 248
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-06-04