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

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

ollieday/yii2-uuid
==================

Component for generating UUIDs with ramsey/uuid.

v1.0.0(10y ago)62.7k↓50%3BSD-3-ClausePHP

Since Nov 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/OllieDay/yii2-uuid)[ Packagist](https://packagist.org/packages/ollieday/yii2-uuid)[ Docs](https://github.com/ollieday)[ RSS](/packages/ollieday-yii2-uuid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

yii2-uuid
=========

[](#yii2-uuid)

Component for generating UUIDs with [ramsey/uuid](https://github.com/ramsey/uuid)

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

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/).

Either run

`php composer.phar require ollieday/yii2-uuid "*"`

or add

```
"ollieday/yii2-uuid": "*"
```

to the `require` section of your `composer.json` file.

Configuration
-------------

[](#configuration)

Add the component to your config file:

```
'components' => [
	'uuid' => [
		'class' => 'ollieday\uuid\Uuid',
	],
    // ...
]
```

Usage
-----

[](#usage)

```
// Generate a version 1 (time-based) UUID object
$uuid1 = Yii::$app->uuid->uuid1();
echo $uuid1->toString() . "\n"; // i.e. e4eaaaf2-d142-11e1-b3e4-080027620cdd

// Generate a version 3 (name-based and hashed with MD5) UUID object
$uuid3 = Yii::$app->uuid->uuid3(\Ramsey\Uuid\Uuid::NAMESPACE_DNS, 'php.net');
echo $uuid3->toString() . "\n"; // i.e. 11a38b9a-b3da-360f-9353-a5a725514269

// Generate a version 4 (random) UUID object
$uuid4 = Yii::$app->uuid->uuid4();
echo $uuid4->toString() . "\n"; // i.e. 25769c6c-d34d-4bfe-ba98-e0ee856f3e7a

// Generate a version 5 (name-based and hashed with SHA1) UUID object
$uuid5 = Yii::$app->uuid->uuid5(\Ramsey\Uuid\Uuid::NAMESPACE_DNS, 'php.net');
echo $uuid5->toString() . "\n"; // i.e. c4a760a8-dbcf-5254-a0d9-6a4474bd1b62
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3845d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a21b9629e4c900290b2b878b91282157070d12869152649f5b3807c9c09ef09?d=identicon)[OllieDay](/maintainers/OllieDay)

---

Top Contributors

[![OllieDay](https://avatars.githubusercontent.com/u/9725880?v=4)](https://github.com/OllieDay "OllieDay (9 commits)")

---

Tags

phpuuidyii2yii2-componentuuididentifierguidyii2extension

### Embed Badge

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

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

###  Alternatives

[pascaldevink/shortuuid

PHP 7.4+ library that generates concise, unambiguous, URL-safe UUIDs

5951.8M15](/packages/pascaldevink-shortuuid)[thamtech/yii2-uuid

Yii 2 UUID Helper

35347.9k7](/packages/thamtech-yii2-uuid)[keiko/uuid-shortener

A simple shortener library for RFC 4122 compatible UUIDs. Change your 36 chars long UUID into it's shorter equivalent.

150215.4k2](/packages/keiko-uuid-shortener)[ekreative/uuid-extra-bundle

Paramconverter, Normalizer and Form Type for Ramsey Uuid

18168.6k](/packages/ekreative-uuid-extra-bundle)[pyyoshi/shortuuid-php

2226.1k](/packages/pyyoshi-shortuuid-php)[ramsey/identifier

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

603.0k1](/packages/ramsey-identifier)

PHPackages © 2026

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