https://github.com/itinysun/tp-model-helper
根据数据库的字段,以及模型的获取器和修改器等方法,自动生成模型的注释。以便于IDE可以获得类型提示。根据模型字段写入schema,以后发布项目无需更新字段缓存
https://github.com/itinysun/tp-model-helper
ide-helper php thinkphp thinkphp6
Last synced: 4 months ago
JSON representation
根据数据库的字段,以及模型的获取器和修改器等方法,自动生成模型的注释。以便于IDE可以获得类型提示。根据模型字段写入schema,以后发布项目无需更新字段缓存
- Host: GitHub
- URL: https://github.com/itinysun/tp-model-helper
- Owner: Itinysun
- Created: 2021-09-03T09:09:13.000Z (over 4 years ago)
- Default Branch: 1.0
- Last Pushed: 2021-11-03T13:23:31.000Z (over 4 years ago)
- Last Synced: 2025-02-20T02:21:35.820Z (over 1 year ago)
- Topics: ide-helper, php, thinkphp, thinkphp6
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ThinkPHP6 模型注释和模型字段自动生成助手
## 功能
- 根据数据库的字段,以及模型的获取器和修改器等方法,自动生成模型的注释。以便于IDE可以获得类型提示。
- 根据模型字段写入schema,以后发布项目无需更新字段缓存,查看https://www.kancloud.cn/manual/thinkphp6_0/1037581了解schema
### 安装
~~~
composer require itinysun/tp-model-helper
修改 配置文件
config/console/model_help
确保已经配置了数据库连接,并且可以连接到数据库
~~~
### 使用方法
~~~
//更新所有模型
php think model:help
//更新指定模型
php think model:help app\model\User app\model\Post
//清理所有模型
php think model:help -C
//清理指定模型
php think model:help app\model\User app\model\Post -C
~~~
#### 可选参数
~~~
--clean [-C] 清理模式,根据提示清理生成的注释和字段
--overwrite [-O] 强制覆盖已有的属性注释
~~~
#### 感谢
本项目修改自 yunwuxin/think-model-helper