PHPackages                             eig/uuid - 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. eig/uuid

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

eig/uuid
========

UUID allowing easy generation and assignment for event sourced systems

2.5.2(3y ago)01.6k21MITPHPPHP ^8.0.2CI failing

Since Nov 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/excellentingenuity/UUID)[ Packagist](https://packagist.org/packages/eig/uuid)[ Docs](https://github.com/excellentingenuity/UUID)[ RSS](/packages/eig-uuid/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (18)Used By (1)

UUID
====

[](#uuid)

[![Build Status](https://camo.githubusercontent.com/0766e14c1fed20d831c0e5df23b1a7b2be037b7b747681f09c67c626b9d052a1/68747470733a2f2f7472617669732d63692e6f72672f657863656c6c656e74696e67656e756974792f555549442e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/excellentingenuity/UUID)[![Latest Stable Version](https://camo.githubusercontent.com/f1ba4c437983d70822a5c3440851d76466de777386727b71732ac96b958cef19/68747470733a2f2f706f7365722e707567782e6f72672f6569672f757569642f762f737461626c65)](https://packagist.org/packages/eig/uuid)[![Coverage Status](https://camo.githubusercontent.com/746bc2f4952975b19ae21b53d94ed0e046f3ed53c204a191b7bedadf2c8b2154/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f657863656c6c656e74696e67656e756974792f555549442f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/excellentingenuity/UUID?branch=master)[![License](https://camo.githubusercontent.com/d1bb7db4a72d3630067a0d8158219de48eb7239e478188e93169530199fbd4a4/68747470733a2f2f706f7365722e707567782e6f72672f6569672f757569642f6c6963656e7365)](https://packagist.org/packages/eig/uuid)[![StyleCI](https://camo.githubusercontent.com/44c9aea73e98ae41d459ef5f29a692ba39100bca2825f52a3da92e38837e6fa0/68747470733a2f2f7374796c6563692e696f2f7265706f732f37333733373639322f736869656c64)](https://styleci.io/repos/73737692)[![Total Downloads](https://camo.githubusercontent.com/490c7bc6fc9049c28a9caa24d60bfc6a03988d9fa284e54a12d55f3b9eb783cd/68747470733a2f2f706f7365722e707567782e6f72672f6569672f757569642f646f776e6c6f616473)](https://packagist.org/packages/eig/uuid)[![Latest Unstable Version](https://camo.githubusercontent.com/c3ce9903f80edd7947cacd588b35c4bf2be90d688131ef36ad029eabe4ab0400/68747470733a2f2f706f7365722e707567782e6f72672f6569672f757569642f762f756e737461626c65)](https://packagist.org/packages/eig/uuid)

Supported PHP Versions
----------------------

[](#supported-php-versions)

- 7.2
- 7.3
- 7.4
- 8.0

Version Support
===============

[](#version-support)

- For PHP 5.5 use the [0.0.5 branch releases](https://github.com/excellentingenuity/UUID/releases/tag/0.5.5-2)
- For PHP 5.6 use the [1.1.x branch releases](https://github.com/excellentingenuity/UUID/releases/tag/1.1.3)
- For PHP 7.1 use the [2.1.0 release](https://github.com/excellentingenuity/UUID/releases/tag/2.1.0)
- For PHP 7.2 use the [2.4.x release](https://github.com/excellentingenuity/UUID/releases/tag/2.4.1)
- For PHP 8.0+ use the [2.5.x release](https://github.com/excellentingenuity/UUID/releases/tag/2.5.0)

Description
-----------

[](#description)

A wrapper package for easy use of the excellent Ramsey\\UUID package. Currently the package generates a version 4 UUID according to [RFC 4122](https://tools.ietf.org/html/rfc4122).

This package provides 2 methods of generating a UUID.

1. Static Facade UUID with a generate method.
2. AssignUUID Trait that defaults to a class variable of `$id` or accepts the string name of a class variable to assign the uuid to.

Static Method Example
---------------------

[](#static-method-example)

```
use eig\UUID;

class Example {

    protected $id;

    public function __construct()
    {
        $this->id = UUID::generate();
    }
}

```

AssignUUID Trait Example
------------------------

[](#assignuuid-trait-example)

```
use eig\UUID\AssignUUID;

class Example
{
    use AssignUUID;

    /**
     * @var
     */
    protected $id;

    /**
     * Example constructor.
     */
    public function __construct ()
    {
        $this->assignUUID();
    }

    /**
     * getID
     * @return mixed
     */
    public function getID()
    {
        return $this->id;
    }
}

```

Or with a class variable other than `$id`

```
use eig\UUID\AssignUUID;

/**
 * Class AlternateFieldExample
 * @package eig\UUID
 * @license MIT
 * @author James Johnson
 * @author Excellent InGenuity LLC
 */
class AlternateFieldExample
{
    use AssignUUID;

    /**
     * @var
     */
    protected $alternateID;

    /**
     * AlternateFieldExample constructor.
     */
    public function __construct ()
    {
        $this->assignUUID('alternateID');
    }

    /**
     * getAlternateID
     * @return mixed
     */
    public function getAlternateID()
    {
        return $this->alternateID;
    }
}

```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity77

Established project with proven stability

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

Recently: every ~239 days

Total

13

Last Release

1298d ago

Major Versions

1.1.3 → 2.0.02017-08-03

PHP version history (5 changes)1.0.0PHP &gt;=5.6

2.0.0PHP &gt;=7.0

2.1.0PHP &gt;=7.1

2.2.0PHP &gt;=7.2

2.5.0PHP ^8.0.2

### Community

Maintainers

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

---

Top Contributors

[![excellentingenuity](https://avatars.githubusercontent.com/u/1653629?v=4)](https://github.com/excellentingenuity "excellentingenuity (66 commits)")

---

Tags

uuidevent sourcing

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eig-uuid/health.svg)

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

###  Alternatives

[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k78.3k90](/packages/pocketmine-pocketmine-mp)[firefly-iii/data-importer

Firefly III Data Import Tool.

8045.8k](/packages/firefly-iii-data-importer)[mynaparrot/plugnmeet-sdk

plugNmeet PHP SDK

102.8k](/packages/mynaparrot-plugnmeet-sdk)

PHPackages © 2026

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