PHPackages                             cline/strongly-typed-id - 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. cline/strongly-typed-id

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

cline/strongly-typed-id
=======================

Strongly-typed ID value objects for PHP with support for UUID, ULID, NanoID, GUID, Sqid, Hashids and Laravel integration

3.0.1(2mo ago)01.8k↑1150%MITPHPPHP ^8.5.0CI failing

Since Dec 30Pushed 3mo agoCompare

[ Source](https://github.com/faustbrian/strongly-typed-id)[ Packagist](https://packagist.org/packages/cline/strongly-typed-id)[ RSS](/packages/cline-strongly-typed-id/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (22)Versions (14)Used By (0)

[![GitHub Workflow Status](https://camo.githubusercontent.com/38b653d49a41966d99c325844207ec82ef602d968f11d54053e10e7dc05b8b14/68747470733a2f2f6769742e636c696e652e73682f6661757374627269616e2f7374726f6e676c792d74797065642d69642f616374696f6e732f776f726b666c6f77732f7175616c6974792d6173737572616e63652e79616d6c2f62616467652e737667)](https://git.cline.sh/faustbrian/strongly-typed-id/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/10f4e217f22df9c4dd41757680e8d6d4e15bb40992fa54fbd8e0fcc0a96c36b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c696e652f7374726f6e676c792d74797065642d69642e737667)](https://packagist.org/packages/cline/strongly-typed-id)[![Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/ed9ff050c868a9b6be0a9ccbdaa7507a0f09791e2370d17377ac3f564be81256/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c696e652f7374726f6e676c792d74797065642d69642e737667)](https://packagist.org/packages/cline/strongly-typed-id)

---

This library provides strongly-typed ID value objects for PHP 8.4+, designed to create type-safe entity identifiers with support for multiple ID generation strategies including UUID variants (v1, v3, v4, v5, v6, v7, v8), ULID, NanoID, GUID, Sqids, Hashids, Prefixed IDs (Stripe-style with configurable generators), Random String, and Random Bytes.

Requirements
------------

[](#requirements)

> **Requires [PHP 8.4+](https://php.net/releases/)**

Installation
------------

[](#installation)

```
composer require cline/strongly-typed-id
```

Documentation
-------------

[](#documentation)

- **[Getting Started](https://docs.cline.sh/strongly-typed-id/getting-started/)** - Installation and quick start
- **[Basic Usage](https://docs.cline.sh/strongly-typed-id/basic-usage/)** - Creating and using IDs
- **[Laravel Integration](https://docs.cline.sh/strongly-typed-id/laravel-integration/)** - Eloquent casts and Data DTOs
- **[UUID Variants](https://docs.cline.sh/strongly-typed-id/uuid-variants/)** - UUID versions v1-v8
- **[ULID](https://docs.cline.sh/strongly-typed-id/ulid/)** - Sortable identifiers
- **[NanoID](https://docs.cline.sh/strongly-typed-id/nanoid/)** - Compact URL-friendly IDs
- **[GUID](https://docs.cline.sh/strongly-typed-id/guid/)** - Windows/.NET compatibility
- **[Sqid](https://docs.cline.sh/strongly-typed-id/sqid/)** - Short URL-safe identifiers
- **[Hashids](https://docs.cline.sh/strongly-typed-id/hashids/)** - Obfuscated IDs with salt
- **[Prefixed IDs](https://docs.cline.sh/strongly-typed-id/prefixed-id/)** - Stripe-style prefixed identifiers
- **[Random String](https://docs.cline.sh/strongly-typed-id/random-string/)** - Alphanumeric with Laravel's Str::random()
- **[Random Bytes](https://docs.cline.sh/strongly-typed-id/random-bytes/)** - Hexadecimal with PHP's random\_bytes()
- **[Advanced Patterns](https://docs.cline.sh/strongly-typed-id/advanced-patterns/)** - DDD, CQRS, multi-tenancy

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://git.cline.sh/faustbrian/strongly-typed-id/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Brian Faust](https://git.cline.sh/faustbrian)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License. Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance83

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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 ~13 days

Recently: every ~0 days

Total

13

Last Release

61d ago

Major Versions

1.x-dev → 2.0.02026-03-04

2.x-dev → 3.0.02026-03-18

PHP version history (3 changes)1.0.0PHP ^8.4

1.1.0PHP ^8.4.0

1.2.0PHP ^8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22145591?v=4)[Brian Faust](/maintainers/faustbrian)[@faustbrian](https://github.com/faustbrian)

---

Top Contributors

[![faustbrian](https://avatars.githubusercontent.com/u/22145591?v=4)](https://github.com/faustbrian "faustbrian (13 commits)")

---

Tags

laravelValue ObjecteloquenthashidsuuididentifierguidulidDomain Driven Designdddstrongly-typednanoidtype-safetysqid

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/cline-strongly-typed-id/health.svg)

```
[![Health](https://phpackages.com/badges/cline-strongly-typed-id/health.svg)](https://phpackages.com/packages/cline-strongly-typed-id)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

15828.6k](/packages/relaticle-custom-fields)[rorecek/laravel-ulid

Laravel package for ULID (Universally Unique Lexicographically Sortable Identifier)

52160.3k1](/packages/rorecek-laravel-ulid)[veelasky/laravel-hashid

HashId Implementation on Laravel Eloquent ORM

46168.5k3](/packages/veelasky-laravel-hashid)

PHPackages © 2026

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