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

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

aracoool/yii2-uuid
==================

Yii 2 UUID Extension. A PHP 7.0+ library for generating RFC 4122 version 3, 4, and 5 universally unique identifiers (UUID).

1.1.1(9y ago)651.9k↓46.2%1MITPHPPHP &gt;=7.0

Since Nov 11Pushed 8y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

aracoool/yii2-uuid
==================

[](#aracooolyii2-uuid)

[![Latest Stable Version](https://camo.githubusercontent.com/5894a8ceefc475ad2146790a0ca59c668eae28083e1e4a041e457718af8b653b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617261636f6f6f6c2f796969322d757569642e737667)](https://packagist.org/packages/aracoool/yii2-uuid)![Packagist](https://camo.githubusercontent.com/e94e3af9c7b1567cd6339e86c9536c0dfcbdf4224b8105f6e5d9857b69f4d224/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617261636f6f6f6c2f796969322d757569642e7376673f7374796c653d666c61742d737175617265)

Yii 2 UUID Extension. A PHP 7.0+ library for generating RFC 4122 version 3, 4, and 5 universally unique identifiers (UUID).

About
-----

[](#about)

From [Wikipedia](http://en.wikipedia.org/wiki/Universally_unique_identifier):

> The intent of UUIDs is to enable distributed systems to uniquely identify information without significant central coordination. In this context the word unique should be taken to mean "practically unique" rather than "guaranteed unique". Since the identifiers have a finite size, it is possible for two differing items to share the same identifier. The identifier size and generation process need to be selected so as to make this sufficiently improbable in practice. Anyone can create a UUID and use it to identify something with reasonable confidence that the same identifier will never be unintentionally created by anyone to identify something else. Information labeled with UUIDs can therefore be later combined into a single database without needing to resolve identifier (ID) conflicts.

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

[](#installation)

The preferred method of installation is via [Packagist](https://packagist.org) and [Composer](https://getcomposer.org/). Run the following command to install the package and add it as a requirement to your project's `composer.json`:

```
composer require --prefer-dist aracoool/yii2-uuid
```

Usage
-----

[](#usage)

### Behavior usage for V4

[](#behavior-usage-for-v4)

```
use \aracoool\yii2-uuid\UuidBehavior

/**
 * @return array
 */
public function behaviors()
{
    return [
        [
            'class' => UuidBehavior::class,
            'version' => Uuid::V4
        ],
        ...
    ];
}
```

### Behavior usage for V3 and V5

[](#behavior-usage-for-v3-and-v5)

```
use \aracoool\yii2-uuid\UuidBehavior

/**
 * @return array
 */
public function behaviors()
{
    return [
        [
            'class' => UuidBehavior::class,
            'version' => Uuid::V3, // Uuid::V5
            'namespace' => Uuid::NAMESPACE_NIL,
            'nameAttribute' => 'title' // Value of this attribute SHOULD be unique in your database
        ],
        ...
    ];
}
```

```
use \aracoool\yii2-uuid\Uuid

Uuid::v3(Uuid::NAMESPACE_URL, 'http://example.com/');
Uuid::v5(Uuid::NAMESPACE_DSN, 'www.google.com');
Uuid::v3(Uuid::NAMESPACE_OID, '1.3.6.1');
Uuid::v5(Uuid::NAMESPACE_X500, 'c=ca');
Uuid::v4();
```

### Validator usage

[](#validator-usage)

```
use \aracoool\yii2-uuid\UuidValidator;

/**
 * @return array
 */
 public function rules()
 {
     return [
         ...
         ['attribute_id', UuidValidator::class],
         ...
     ];
 }
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

3335d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e352205006341e80b4aa8033d5470d216f47bea34e64b2d1290f1537706b0c59?d=identicon)[ARACOOOL](/maintainers/ARACOOOL)

---

Top Contributors

[![ARACOOOL](https://avatars.githubusercontent.com/u/539863?v=4)](https://github.com/ARACOOOL "ARACOOOL (16 commits)")

---

Tags

identifieruuidyii2yii2-uuiduuidguidyii2yii

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[thamtech/yii2-uuid

Yii 2 UUID Helper

35347.9k7](/packages/thamtech-yii2-uuid)[kop/yii2-scroll-pager

Infinite AJAX scrolling for Yii2 ListView widget

180706.5k10](/packages/kop-yii2-scroll-pager)[brussens/yii2-maintenance-mode

Maintenance mode component for Yii framework 2.x.x version.

78256.3k5](/packages/brussens-yii2-maintenance-mode)

PHPackages © 2026

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