PHPackages                             faed/laravle-doc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. faed/laravle-doc

ActiveLibrary

faed/laravle-doc
================

通过反射生成laravel接口文档

4597↓100%PHP

Since Jan 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/by159147/laravele-doc)[ Packagist](https://packagist.org/packages/faed/laravle-doc)[ RSS](/packages/faed-laravle-doc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-doc安装
=============

[](#laravel-doc安装)

> - #### 写文档非常浪费后端同学的时间
>
>     [](#写文档非常浪费后端同学的时间)
> - #### 自动读取 request 的验证规则和方法注释作为请求参数
>
>     [](#自动读取-request-的验证规则和方法注释作为请求参数)
> - #### 读取attributes,validation.php,数据库字段字段作为注释
>
>     [](#读取attributesvalidationphp数据库字段字段作为注释)
> - #### 提供中间件保存返回会自动的生成相关文档
>
>     [](#提供中间件保存返回会自动的生成相关文档)

1. 安装

    ```
    composer require faed/laravle-doc
    ```
2. 发布配置

    ```
    php artisan vendor:publish
    ```
3. 配置

    ```
    return [
        //版本
        'v'=>1,
        //名称
        'name'=>env('APP_NAME'),
        //app名称
        'app_name'=>env('APP_NAME'),
        //请求地址
        'path'=>env('APP_URL'),
        //接口地址发送地址
        'send'=>'http://127.0.0.1:8000',
    	//路由过滤
        'only'=>'api',
        //laravle版本 7.8路由方式不一样默认８请自行定义
        'laravle_versions'=>8,
    	//自动读取数据库的字段注释作为注释，多库请自行定义
        'mysql' => ['mysql'],
    ];
    ```
4. 运行迁移文件生成相关的表

    ```
    php artisan migrate
    ```
5. 运行 自动生成相关的文档数据路由

    ```
    php artisan api:make

    ```

文档编写
====

[](#文档编写)

类注释自动分组,控制器

```
/**
 * @group 接口
 * @package App\Http\Controllers
 */
```

```
/**
 * 说明
 * @q size Y 大小
 * @u page N 分页
 * @b body Y 参数
 */
```

使用
==

[](#使用)

1.  路由

[![image](https://camo.githubusercontent.com/f268759eef5bd1d724f5df54399f96028558c021ad4d96648d27f2c0eb6721f2/687474703a2f2f3131392e32382e35352e3136392f6e61762e706e67)](https://camo.githubusercontent.com/f268759eef5bd1d724f5df54399f96028558c021ad4d96648d27f2c0eb6721f2/687474703a2f2f3131392e32382e35352e3136392f6e61762e706e67)

[![image](https://camo.githubusercontent.com/c70c86d8653233021c73c633d845b22db9605ed0284969e50c4aed9abffbfde4/687474703a2f2f3131392e32382e35352e3136392f646f632e706e67)](https://camo.githubusercontent.com/c70c86d8653233021c73c633d845b22db9605ed0284969e50c4aed9abffbfde4/687474703a2f2f3131392e32382e35352e3136392f646f632e706e67)

2. 提供中间件\[ RecordReturn \]记录返回数据,请自行添加

    ```
       [
            'throttle:api',
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
            RecordReturn::class,
       ];
    ```

    [![image](https://camo.githubusercontent.com/df3ce404a4ec96dd2de354e71f73594f2ee9561c54ff4d8f05a7f8a6f2f72360/687474703a2f2f3131392e32382e35352e3136392f72657475726e2e706e67)](https://camo.githubusercontent.com/df3ce404a4ec96dd2de354e71f73594f2ee9561c54ff4d8f05a7f8a6f2f72360/687474703a2f2f3131392e32382e35352e3136392f72657475726e2e706e67)
3. 读取数据库时需要的时间可能较长提供参数选择

    ```
    php artisan api:make -MC
    ```

> ps:可以作为一个项目多个版本的管理,或者单独布置多个项目接口管理

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/09b91ef0f49949dc0f62e2a63b8cdb4ac70b1cbb23f1c64a003363a709722d25?d=identicon)[by159147](/maintainers/by159147)

---

Top Contributors

[![by159147](https://avatars.githubusercontent.com/u/45205929?v=4)](https://github.com/by159147 "by159147 (41 commits)")

### Embed Badge

![Health badge](/badges/faed-laravle-doc/health.svg)

```
[![Health](https://phpackages.com/badges/faed-laravle-doc/health.svg)](https://phpackages.com/packages/faed-laravle-doc)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
