PHPackages                             ndtan/id-generator - 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. ndtan/id-generator

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

ndtan/id-generator
==================

NDT ID Generator — pluggable PHP ID generation library (UUID v4/v6/v7/v8, ULID, Snowflake, NanoID, KSUID, Mongo ObjectId, ShortUUID) with per-driver configuration and integrations for Laravel &amp; Doctrine.

v0.3.0(9mo ago)02MITPHPPHP &gt;=8.1CI passing

Since Sep 21Pushed 9mo agoCompare

[ Source](https://github.com/nguyenduytan/NDT-ID-Generator)[ Packagist](https://packagist.org/packages/ndtan/id-generator)[ Fund](https://nguyenduytan.com)[ GitHub Sponsors](https://github.com/sponsors/nguyenduytan)[ RSS](/packages/ndtan-id-generator/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

NDT ID Generator (Full)
=======================

[](#ndt-id-generator-full)

[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![PHP](https://camo.githubusercontent.com/ab828ceaf31f2952dc4c9f1c8e712fd700410c57f8dd0ebb8fb6ae986a8b15f5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737376262332e737667)](#)[![CI](https://camo.githubusercontent.com/656e81c9cd2ab9ee4fa132b8b3855dcc34ed29fc913796e46b87a0249cb7a995/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e677579656e64757974616e2f4e44542d49442d47656e657261746f722f7068702e796d6c3f6c6162656c3d4349)](#)[![Packagist](https://camo.githubusercontent.com/d76cccc513f3e0d24087ded955d5571e5133a5c10e1b95f4002cd52bcff1d314/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d72656164792d626c75652e737667)](#)

Pluggable PHP ID generation library — **UUID v4/v6/v7/v8, ULID, Snowflake, NanoID, KSUID, Mongo ObjectId, ShortUUID** — with per-driver options and integrations for **Laravel** &amp; **Doctrine**. Namespace: `ndtan` · PHP 8.1+

---

Features
--------

[](#features)

- ✅ Multiple strategies: UUID v4/v6/v7/v8, ULID (monotonic option), Snowflake, NanoID, KSUID, Mongo ObjectId, ShortUUID(Base58)
- ✅ Pluggable drivers via `IdGeneratorInterface` + `Manager`
- ✅ Per-driver configuration (epoch/worker/datacenter/alphabet/size/monotonic…)
- ✅ Framework integrations: **Laravel ServiceProvider**, **Doctrine DBAL types**
- ✅ Tests + GitHub Actions CI, MIT License

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

[](#installation)

```
composer require ndtan/id-generator
```

Quick Start
-----------

[](#quick-start)

```
use ndtan\Manager;
use ndtan\Uuid\UuidV7Generator;
use ndtan\Ulid\UlidGenerator;
use ndtan\Snowflake\SnowflakeGenerator;

$mgr = new Manager([
  'default' => 'uuid7',
  'drivers' => [
    'uuid7' => [ 'class' => UuidV7Generator::class ],
    'ulid'  => [ 'class' => UlidGenerator::class, 'monotonic' => true ],
    'snowflake' => [ 'class' => SnowflakeGenerator::class, 'epoch' => '2020-01-01T00:00:00Z' ],
  ]
]);

echo $mgr->generate();                 // UUIDv7
echo $mgr->driver('ulid')->generate(); // ULID
```

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

[](#documentation)

- Getting started: **docs/GETTING\_STARTED.md**
- Driver reference (all options): **docs/DRIVERS.md**
- Laravel &amp; Doctrine integration: **docs/INTEGRATIONS.md**

Roadmap
-------

[](#roadmap)

- Benchmarks workflow, PHPStan/Psalm
- Additional encoders (Base32/Base64 for binaries)
- More framework snippets (Symfony bundle, Laminas)

License
-------

[](#license)

MIT © Tony Nguyen

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance57

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

285d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/551820?v=4)[Tony Nguyen](/maintainers/nguyenduytan)[@nguyenduytan](https://github.com/nguyenduytan)

---

Top Contributors

[![nguyenduytan](https://avatars.githubusercontent.com/u/551820?v=4)](https://github.com/nguyenduytan "nguyenduytan (5 commits)")

---

Tags

phplibraryuuidulidmongosnowflakeksuidnanoidid-generatorObjectIdndtanuuidv7shortuuiduuid6uuid8

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ndtan-id-generator/health.svg)

```
[![Health](https://phpackages.com/badges/ndtan-id-generator/health.svg)](https://phpackages.com/packages/ndtan-id-generator)
```

###  Alternatives

[infocyph/uid

UUID (RFC 9562), ULID, Snowflake ID, Sonyflake ID, and TBSL generator for PHP.

116.0k](/packages/infocyph-uid)[identifier/identifier

Common Interfaces and Factories for Identifiers

3233.4k1](/packages/identifier-identifier)[ramsey/identifier

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

606.9k2](/packages/ramsey-identifier)[riipandi/laravel-optikey

Use UUID, Ulid, or nanoid as optional or primary key in Laravel.

429.3k](/packages/riipandi-laravel-optikey)

PHPackages © 2026

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