PHPackages                             dev-tool/laravel-dev-tool - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dev-tool/laravel-dev-tool

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dev-tool/laravel-dev-tool
=========================

model-annotation、ide-helper...

3.1.0(4y ago)017MITPHPPHP &gt;=7.3.0

Since Dec 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/guxiangming/laravel-dev-tool)[ Packagist](https://packagist.org/packages/dev-tool/laravel-dev-tool)[ RSS](/packages/dev-tool-laravel-dev-tool/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (19)Used By (0)

背景
==

[](#背景)

- 在编写程序过程中，部分ide会检测标注提示所使用的类属性对象是否存在，如果不存在则警告错误，这个现象在laravel-model对象调用较为常见。在一般情况下去优化ide提示，需要进行手动写入注解，这样的步骤机械而重复。所以希望能拥有脚本能自动生成与更新文件注解。

需求调查
====

[](#需求调查)

- 经过查找php生态已经有可用的注解生成工具，但功能存在缺陷，仅支持对数据库字段进行注解。针对复杂的laravel-model需要从关联模型、表字段、attribute、casts、scope等特性考虑。

安装步骤
====

[](#安装步骤)

1. 检测composer.json是否限制中央服务器下载,如果限制则移除

```
移除代码
{
 "packagist.org": false =>  "packagist.org": true
}

```

2. 安装到开发依赖

composer require dev-tool/laravel-dev-tool --dev

3. 发布配置 php artisan vendor:publish --tag=dev-tool-config

配置说明
====

[](#配置说明)

- 文件位置 config/dev-tool.php

```
 /**
     *  Model注解批量管理类
     */
    'model_annotation_helper' =>[
        'auto_model'=>[
            //自动注解的model
        ],
        'auto_dir'=>[
            //自动注解的目录
        ],
        'ignored_model'=>[
            //需要排除自动注解的model
        ],
        'ignored_dir'=>[
            //需要排除自动注解的model
        ],
    ],

```

运行命令
====

[](#运行命令)

- php artisan model-annotation-helper:generate --model="" //model参数填写 文件命名空间+类名

1. php artisan model-annotation-helper:generate //根据读取配置文件生产注解
2. php artisan model-annotation-helper:generate --model="" //根据读取配置文件+指定类生成注解
3. php artisan model-annotation-helper:generate --dir="" //根据读取配置文件+指定目录生成注解
4. php artisan model-annotation-helper:generate --dir="" --model="" //根据读取配置文件+指定目录生成注解+指定类生成注解
5. php artisan model-annotation-helper:generate --ignored-config=true --model="" --dir="" //忽略config配置只生成指定位置注解

注意事项
====

[](#注意事项)

1. 生成的注解中的类中如果不存在引入情况，不会自动添加
2. 每次扫描生成新的注解会兼容用户自定义的注释
3. 请勿提交composer.json

todo
====

[](#todo)

1. 兼容内网环境

openApi
=======

[](#openapi)

1. 同步机制大家需要把代码合并到开发分支避免版本冲突问题

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~49 days

Total

17

Last Release

1474d ago

Major Versions

1.0.6 → v2.02021-12-07

2.5.0 → 3.0.22022-06-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29277221?v=4)[guxiangming](/maintainers/guxiangming)[@guxiangming](https://github.com/guxiangming)

---

Tags

model ide

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dev-tool-laravel-dev-tool/health.svg)

```
[![Health](https://phpackages.com/badges/dev-tool-laravel-dev-tool/health.svg)](https://phpackages.com/packages/dev-tool-laravel-dev-tool)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[october/rain

October Rain Library

1601.7M83](/packages/october-rain)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[oat-sa/tao-core

TAO core extension

66143.7k122](/packages/oat-sa-tao-core)[typo3/cms-redirects

TYPO3 CMS Redirects - Create manual redirects, list existing redirects and automatically createredirects on slug changes.

167.4M80](/packages/typo3-cms-redirects)[rias/statamic-redirect

29335.6k](/packages/rias-statamic-redirect)

PHPackages © 2026

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