PHPackages                             lampge/ulid - 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. lampge/ulid

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

lampge/ulid
===========

Laravel package Use to auto product primary key.

v0.2.6(7y ago)0321PHPPHP &gt;=7.1.2

Since May 15Pushed 7y ago1 watchersCompare

[ Source](https://github.com/812913889/laravel-ulid)[ Packagist](https://packagist.org/packages/lampge/ulid)[ RSS](/packages/lampge-ulid/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (5)Versions (10)Used By (1)

Laravel ULID
============

[](#laravel-ulid)

Laravel package to generate ULID (Universally Unique Lexicographically Sortable Identifier), which also contains trait for your models that will let you generate ULID ids for your Eloquent models automatically. Based on **robinvdvleuten/php-ulid**.

這個專案根據 **rorecek/laravel-ulid** 進行修改，修改一些路徑參考的錯誤，和 composer update 時會發生的錯誤，然後優化了一些使用

Usage
-----

[](#usage)

### Migrations

[](#migrations)

使用 char 26 進行宣告

```
$table->char('id', 26)
    ->comment('[PK] 資料識別碼');

```

### Models

[](#models)

在要使用的 ORM 檔案中 `use Ariby\Ulid\HasUlid`

```
use Illuminate\Database\Eloquent\Model;
use ariby\Ulid\HasUlid;

class Item extends Model
{
  use HasUlid;

  ....
}
```

即可

### 動態產生

[](#動態產生)

若是需要在程式中動態產生 ulid

需要於命名空間 `use Ariby\Ulid\Ulid;`

即可使用動態方法 `(string)Ulid::generate()` 取得

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~32 days

Total

10

Last Release

2759d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14066080?v=4)[lampge](/maintainers/lampge)[@lampge](https://github.com/lampge)

---

Top Contributors

[![defsrisars](https://avatars.githubusercontent.com/u/16033905?v=4)](https://github.com/defsrisars "defsrisars (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lampge-ulid/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M276](/packages/illuminate-pipeline)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[illuminate/redis

The Illuminate Redis package.

8314.6M369](/packages/illuminate-redis)

PHPackages © 2026

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