PHPackages                             freyr/identity - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. freyr/identity

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

freyr/identity
==============

A PHP library for Identity concept.

v1.0.1(2mo ago)01.2k3MITPHPPHP ^8.2 || ^8.3 || ^8.4CI passing

Since Jun 9Pushed 2mo agoCompare

[ Source](https://github.com/freyr/identity)[ Packagist](https://packagist.org/packages/freyr/identity)[ RSS](/packages/freyr-identity/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (22)Versions (12)Used By (3)

Freyr Identity
==============

[](#freyr-identity)

Monotonic ULID identity objects for PHP domain models. Provides an immutable `Id` value object and an `IdCollection` for working with sets of identifiers.

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

[](#installation)

```
composer require freyr/identity
```

Requires PHP 8.2+.

Usage
-----

[](#usage)

### Id

[](#id)

Create, convert and compare identifiers.

```
use Freyr\Identity\Id;

$id = Id::new();
$id = Id::fromString('01ARYZ6S41TSV4RRFFQ69G5FAV');
$id = Id::fromBinary($bytes);

(string) $id;    // ULID string (26 chars, Crockford Base32)
$id->toBinary(); // 16-byte binary
$id->sameAs($other);
```

Extend for typed identifiers.

```
class UserId extends Id {}

$userId = UserId::new();
```

### IdCollection

[](#idcollection)

Immutable collection with standard operations.

```
use Freyr\Identity\IdCollection;

$collection = IdCollection::fromArray([$id1, $id2]);
$collection = IdCollection::empty();

$collection->add($id);
$collection->remove($id);
$collection->contains($id);
$collection->merge($other);
$collection->intersect($other);
$collection->filter(fn (Id $id) => /* ... */);
$collection->map(fn (Id $id) => /* ... */);

$collection->first();
$collection->last();
$collection->count();
$collection->isEmpty();
$collection->toArray();
$collection->toStringArray();
$collection->toBinaryArray();
```

All mutating methods return new instances.

Licence
-------

[](#licence)

MIT

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance85

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% 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 ~38 days

Total

8

Last Release

78d ago

Major Versions

0.4.0 → 1.0.02026-03-01

PHP version history (3 changes)0.1.0PHP ^8.4

0.4.0PHP ^8.2

1.0.0PHP ^8.2 || ^8.3 || ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/089ad642f79ded10ae84d86db9f2a71b74c88e02fdd3b57af9643951d41420d4?d=identicon)[Freyr](/maintainers/Freyr)

---

Top Contributors

[![freyr](https://avatars.githubusercontent.com/u/800286?v=4)](https://github.com/freyr "freyr (15 commits)")[![michal-giergielewicz](https://avatars.githubusercontent.com/u/203011665?v=4)](https://github.com/michal-giergielewicz "michal-giergielewicz (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/freyr-identity/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5682.0M15](/packages/directorytree-ldaprecord-laravel)[web-auth/webauthn-lib

FIDO2/Webauthn Support For PHP

1225.3M72](/packages/web-auth-webauthn-lib)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

50570.7k1](/packages/web-auth-webauthn-framework)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)

PHPackages © 2026

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