Skip to content

根据数据库的字段,以及模型的获取器和修改器等方法,自动生成模型的注释。以便于IDE可以获得类型提示。根据模型字段写入schema,以后发布项目无需更新字段缓存

Notifications You must be signed in to change notification settings

Itinysun/tp-model-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThinkPHP6 模型注释和模型字段自动生成助手

功能

安装


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

About

根据数据库的字段,以及模型的获取器和修改器等方法,自动生成模型的注释。以便于IDE可以获得类型提示。根据模型字段写入schema,以后发布项目无需更新字段缓存

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages