PHPackages                             phpgears/identity-extra - 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. phpgears/identity-extra

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

phpgears/identity-extra
=======================

Identity object for PHP

0.2.2(5y ago)12MITPHPPHP ^7.1CI failing

Since Sep 22Pushed 5y ago2 watchersCompare

[ Source](https://github.com/phpgears/identity-extra)[ Packagist](https://packagist.org/packages/phpgears/identity-extra)[ Docs](https://github.com/phpgears/identity-extra)[ RSS](/packages/phpgears-identity-extra/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (22)Versions (4)Used By (0)

[![PHP version](https://camo.githubusercontent.com/d0b5687c6812c5d52d86a548e09db527eeb7860f82adbb677de00a36ddbed1b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e312d3838393242462e7376673f7374796c653d666c61742d737175617265)](http://php.net)[![Latest Version](https://camo.githubusercontent.com/c2a80a131ec7ac1fa120533961e6d246b38e88f7def0790981c48b4f06a2ffe4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70687067656172732f6964656e746974792d65787472612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/identity-extra)[![License](https://camo.githubusercontent.com/92d465d26b65dfb0f4a472884e01cec274df1582f0735fd3904660f8c6fe8320/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70687067656172732f6964656e746974792d65787472612e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpgears/identity-extra/blob/master/LICENSE)

[![Build Status](https://camo.githubusercontent.com/b0c955f067210f3882c2769931259c4c95022c0f965f65344b6a04a31a1dddc6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f70687067656172732f6964656e746974792d65787472612e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/github/phpgears/identity-extra)[![Style Check](https://camo.githubusercontent.com/a7963192978c52a38e6bfaf07d7f75cf697db5bbb5862a8611048d96816e6fcb/68747470733a2f2f7374796c6563692e696f2f7265706f732f3138383439343835372f736869656c64)](https://styleci.io/repos/188494857)[![Code Quality](https://camo.githubusercontent.com/dfdab021d7854172f786d486d55fd1ad9f569a443a02e45e157715e8ff38feb4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f70687067656172732f6964656e746974792d65787472612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/phpgears/identity-extra)[![Code Coverage](https://camo.githubusercontent.com/c99f76f4c6625c069587c2f483c10f107f2c422dd1ef51449b3848667d040acf/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f70687067656172732f6964656e746974792d65787472612e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/phpgears/identity-extra)

[![Total Downloads](https://camo.githubusercontent.com/1f4aef120db4a62fbbfe9be982c00be6d6ea15fe89f31d5790b41a1d1352987d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70687067656172732f6964656e746974792d65787472612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/identity-extra/stats)[![Monthly Downloads](https://camo.githubusercontent.com/beda77a456e80d3a483c2ec59359bbe75eb0f1868bdfafa1cd54cc88221fab3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f70687067656172732f6964656e746974792d65787472612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/identity-extra/stats)

Identity Extra
==============

[](#identity-extra)

Non UUID based identity objects for PHP

This package extends [phpgears/identity](https://github.com/phpgears/identity) to provide non UUID-based identities

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

[](#installation)

### Composer

[](#composer)

```
composer require phpgears/identity-extra

```

Usage
-----

[](#usage)

Require composer autoload file

```
require './vendor/autoload.php';
```

#### Mongo ObjectId

[](#mongo-objectid)

You need to install and enable ext-mongodb through your distro's repos or PECL

```
sudo pecl install mongodb

```

```
use Gears\Identity\Extra\ObjectIdIdentity;
use Gears\Identity\Extra\ObjectIdIdentityGenerator;
use MongoDB\BSON\ObjectId;

$identity = ObjectIdIdentity::fromString((string) new ObjectId());

// From generator
$identity = (new ObjectIdIdentityGenerator())->generate();
```

#### ULID (Universally Unique Lexicographically Sortable Identifier)

[](#ulid-universally-unique-lexicographically-sortable-identifier)

you need to require

```
composer require obinvdvleuten/ulid

```

```
use Gears\Identity\Extra\UlidIdentity;
use Gears\Identity\Extra\UlidIdentityGenerator;
use Ulid\Ulid;

$identity = UlidIdentity::fromString((string) Ulid::generate());

// From generator
$identity = (new UlidIdentityGenerator())->generate();
```

Find more information about ULID at

#### KSUID (K-Sortable Globally Unique IDs)

[](#ksuid-k-sortable-globally-unique-ids)

you need to require

```
composer require tuupola/ksuid

```

```
use Gears\Identity\Extra\KsuidIdentity;
use Gears\Identity\Extra\KsuidIdentityGenerator;
use Tuupola\KsuidFactory;

$identity = KsuidIdentity::fromString((string) KsuidFactory::create());

// From generator
$identity = (new KsuidIdentityGenerator())->generate();
```

Find more information about KSUID at

#### Xid (Globally Unique ID)

[](#xid-globally-unique-id)

you need to require

```
composer require fpay/xid-php

```

```
use Gears\Identity\Extra\XidIdentity;
use Gears\Identity\Extra\XidIdentityGenerator;
use Fpay\Xid\Generator;

$identity = XidIdentity::fromString((string) Generator::create());

// From generator
$identity = (new XidIdentityGenerator())->generate();
```

Find more information about Xid at

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

[](#contributing)

Found a bug or have a feature request? [Please open a new issue](https://github.com/phpgears/identity-extra/issues). Have a look at existing issues before.

See file [CONTRIBUTING.md](https://github.com/phpgears/identity-extra/blob/master/CONTRIBUTING.md)

License
-------

[](#license)

See file [LICENSE](https://github.com/phpgears/identity-extra/blob/master/LICENSE) included with the source code for a copy of the license terms.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

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

Total

3

Last Release

2002d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c50421f1ab4148354dc2dd5dcaba168656b17ea913b310d112deb39a6f73ca1?d=identicon)[juliangut](/maintainers/juliangut)

---

Top Contributors

[![juliangut](https://avatars.githubusercontent.com/u/1104131?v=4)](https://github.com/juliangut "juliangut (12 commits)")

---

Tags

identityimmutable

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)[qaribou/immutable.php

Immutable, highly-performant collections, well-suited for functional programming and memory-intensive applications.

344146.0k](/packages/qaribou-immutablephp)[douyasi/identity-card

Chinese Identity Card package

17851.4k3](/packages/douyasi-identity-card)[innmind/immutable

Immutable PHP primitive wrappers

75218.0k74](/packages/innmind-immutable)[rtlopez/decimal

An object oriented immutable arbitrary-precision arithmetic library for PHP

27262.8k2](/packages/rtlopez-decimal)[aeon-php/calendar-holidays

Holidays calendar abstraction layer for Aeon Time management framework

14212.4k3](/packages/aeon-php-calendar-holidays)

PHPackages © 2026

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