PHPackages                             liaosankai/eloquent-reinforce - 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. liaosankai/eloquent-reinforce

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

liaosankai/eloquent-reinforce
=============================

Laravel Eloquent Model Reinforce

v0.0.1(7y ago)09PHPPHP &gt;=7.0.0

Since May 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/liaosankai/eloquent-reinforce)[ Packagist](https://packagist.org/packages/liaosankai/eloquent-reinforce)[ Docs](https://github.com/liaosankai/eloquent-reinforce)[ RSS](/packages/liaosankai-eloquent-reinforce/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (2)Used By (0)

Eloquent Reinforce
==================

[](#eloquent-reinforce)

補充官方 Model 在專案缺少的功能

### Ulid 主鍵 (HasUlidPrimaryKey)

[](#ulid-主鍵-hasulidprimarykey)

停用 Model 原本的自動增號的數字主鍵方式，改以 `robinvdvleuten/ulid` 產生的 Ulid 字串代替

### 多語系日期時間 (HasI18nAsDateTime)

[](#多語系日期時間-hasi18nasdatetime)

原本 Model 設定在 `$dates` 的欄位會取得為 `Carbon\Carbon` 類型資料，使用這個將會以支援多語系的 `Jenssegers\Date\Date` 替代

用法
--

[](#用法)

使用 User 這個 Model 為範例，可以在 `tests/Models` 找到這個類別

```
use Illuminate\Database\Eloquent\Model;
use Liaosankai\EloquentReinforce\Traits\HasI18nAsDateTime;
use Liaosankai\EloquentReinforce\Traits\HasUlidPrimaryKey;

class User extends Model
{
    use HasUlidPrimaryKey;
    use HasI18nAsDateTime;

    protected $dates = [
        'last_login_at'
    ];

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);

        // 除了 id 之外的欄位預設值，應該在建構式透過設定 $attributes 屬性來初始化
        // 避免資料庫忘記設定初始值，建議 Model 都應該定義每個欄位的初始值
        $this->attributes['remark'] = 'Hello World!';
        $this->attributes['last_login_at'] = time();
    }
}

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

2918d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00c4fc8959e532eca722b0bce1a2ee6d24cf52be83739048204a62ae3682db64?d=identicon)[liaosankai](/maintainers/liaosankai)

---

Tags

i18nuuididentifierguidulid

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/liaosankai-eloquent-reinforce/health.svg)

```
[![Health](https://phpackages.com/badges/liaosankai-eloquent-reinforce/health.svg)](https://phpackages.com/packages/liaosankai-eloquent-reinforce)
```

###  Alternatives

[ramsey/uuid

A PHP library for generating and working with universally unique identifiers (UUIDs).

12.6k700.2M3.3k](/packages/ramsey-uuid)[pascaldevink/shortuuid

PHP 7.4+ library that generates concise, unambiguous, URL-safe UUIDs

5951.8M15](/packages/pascaldevink-shortuuid)[keiko/uuid-shortener

A simple shortener library for RFC 4122 compatible UUIDs. Change your 36 chars long UUID into it's shorter equivalent.

150215.4k2](/packages/keiko-uuid-shortener)[identifier/identifier

Common Interfaces and Factories for Identifiers

3226.2k1](/packages/identifier-identifier)[oittaa/uuid

A small PHP class for generating RFC 9562 universally unique identifiers (UUID) from version 3 to version 8.

50302.7k5](/packages/oittaa-uuid)[ramsey/identifier

A PHP library for generating and working with identifiers, including UUIDs, ULIDs, and Snowflakes

603.0k1](/packages/ramsey-identifier)

PHPackages © 2026

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