PHPackages                             webin/build-model - 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. [Database &amp; ORM](/categories/database)
4. /
5. webin/build-model

ActiveLibrary[Database &amp; ORM](/categories/database)

webin/build-model
=================

自动生成数据库表对应model类(TP、Laravel、Yii)

v1.6(2y ago)2144MITPHPPHP &gt;=5.6.0

Since Nov 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/webinchu/build-table-model)[ Packagist](https://packagist.org/packages/webin/build-model)[ RSS](/packages/webin-build-model/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (10)Used By (0)

build-table-model
=================

[](#build-table-model)

composer require webin/build-model

根据表自动生成model类

Thinkphp
--------

[](#thinkphp)

```
可结合make:command

```

1. 根目下执行php think make:command gii-model (生成GiiModel类)
2. 编辑生成的GiiModel类(代码如下)
3. (重要)将GiiModel加入config/console.php(没有的话找下是否有command.php),按照已有的格式写进去('app\\common\\command\\GiiModel' //这个是我自己项目的路径( 按照你自己的路径填写))
4. 执行php think 看看是不是有gii-model
5. 根目录下执行php think gii-model user (user是表名)

```
