PHPackages                             sayid/table2model - 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. sayid/table2model

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

sayid/table2model
=================

078PHP

Since Jun 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sayid/phibatis)[ Packagist](https://packagist.org/packages/sayid/table2model)[ RSS](/packages/sayid-table2model/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

第一步：安装

`"sayid/phibatis" : "dev-master"`

第二步： `config/mybatis.php` 中配置

```
```
return [
    "namespace" => "App\Entities\Base",  //生成类的命名空间
    "output" => app()->basePath("app/Entities/Base"), //生成类输出到什么地方
    "tables" => [
        ["table" => "user", "PriKey" => "user_id", "EntityName" => "User"],//table=表名 PriKey=主键  EntityName=实体类名称
        ['table'=>'memorial_member', "PriKey" => "id", "EntityName" => "Memorial"],
        ['table'=>'tribute', "PriKey" => "id", "EntityName" => "Tribute"],
    ]
];
```

```

第三步： 执行`vendor/bin/mybatis` 自动生成entity类和example类

第四步： 编写业务逻辑

```
$userExample = new UserExample();
$data = $userExample->andUserIdGt(0)->andAvatarNotEQ(0)->getList();
echo $userExample->getBuilder()->toSql();
var_dump($data);
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

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/a151d147f637cdfa5c3c151ecd5b2ff6fbad6b6de71fabd96c34665eb588342f?d=identicon)[zyb88325](/maintainers/zyb88325)

---

Top Contributors

[![sayid](https://avatars.githubusercontent.com/u/362920?v=4)](https://github.com/sayid "sayid (16 commits)")

### Embed Badge

![Health badge](/badges/sayid-table2model/health.svg)

```
[![Health](https://phpackages.com/badges/sayid-table2model/health.svg)](https://phpackages.com/packages/sayid-table2model)
```

PHPackages © 2026

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