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

ActiveLibrary

jeremykenedy/uuid
=================

Laravel package to generate a UUID according to the RFC 4122 standard. UUID Versions 1, 3, 4 and 5 are supported. With MIT license.

v3.1.0(8y ago)23134.7k↓30.7%2MITPHPPHP &gt;=7.0.0CI failing

Since Sep 14Pushed 3y ago1 watchersCompare

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

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

Laravel Uuid (Universally unique identifier)
============================================

[](#laravel-uuid-universally-unique-identifier)

[![Total Downloads](https://camo.githubusercontent.com/c887b5d8cc18d001f9eccb1f3ab099b1b9b2b5c985be25a83a7c5876ed53b3e8/68747470733a2f2f706f7365722e707567782e6f72672f6a6572656d796b656e6564792f757569642f642f746f74616c2e737667)](https://packagist.org/packages/jeremykenedy/uuid)[![StyleCI](https://camo.githubusercontent.com/2ed80064cc9238d02aca5ed9cf410e4d4b6799cef3e07dae62e279bd92424ba1/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f39373735333836392f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/97753869)[![Build Status](https://camo.githubusercontent.com/a0a1e2fccbe3b76b3e2335903972c25239a7c3f46aeed26e8a115a31da56b732/68747470733a2f2f7472617669732d63692e6f72672f6a6572656d796b656e6564792f6c61726176656c2d757569642e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/jeremykenedy/laravel-uuid)[![Latest Stable Version](https://camo.githubusercontent.com/76cd0516cf5605729c63357b0fa0ca76b60e4beaced457d5cd7a77a06e583d89/68747470733a2f2f706f7365722e707567782e6f72672f6a6572656d796b656e6564792f757569642f762f737461626c652e737667)](https://packagist.org/packages/jeremykenedy/uuid)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Laravel package to generate a UUID according to the RFC 4122 standard. UUID Versions 1, 3, 4 and 5 are supported. With MIT license.

- [About](#about)
- [Requirements](#requirements)
- [Installation](#installation)
    - [Laravel 5.5 and above](#laravel-55-and-above)
    - [Laravel 5.4 and below](#laravel-54-and-below)
- [Basic Usage](#basic-usage)
- [Advanced Usage](#advanced-usage)
    - [UUID creation](#uuid-creation)
        - [UUID V1](#uuid-v1)
        - [UUID V3](#uuid-v3)
        - [UUID V4](#uuid-v4)
        - [UUID V5](#uuid-v5)
- [Additional Features](#additional-features)
    - [Import UUID](#import-uuid)
    - [Extract time](#extract-time)
    - [Extract Version](#extract-version)
- [Changelog](#changelog)
    - [2.\*](#2.*)
- [License](#license)
- [Credits](#credits)

### About

[](#about)

Since Laravel `4.*` and `5.*` both rely on either `OpenSSL` or `Mcrypt`, the pseudo random byte generator now tries to use one of them. If both cannot be used (not a Laravel project?), the 'less random' `mt_rand()` function is used.

### Requirements

[](#requirements)

- [Laravel 5.3 - 10](https://laravel.com/docs/installation)

### Installation

[](#installation)

##### Laravel 5.5 and above

[](#laravel-55-and-above)

1. From your projects root folder in terminal run:

```
    composer require jeremykenedy/uuid
```

- Uses package auto discovery feature, no need to edit the `config/app.php` file.

##### Laravel 5.4 and below

[](#laravel-54-and-below)

1. From your projects root folder in terminal run:

```
    composer require jeremykenedy/uuid:2.1.2
```

2. Register the package with laravel in `config/app.php` under `aliases` with the following:

```
    'aliases' => [
        'Uuid' => jeremykenedy\Uuid\Uuid::class,
    ];
```

### Basic Usage

[](#basic-usage)

To quickly generate a UUID just do

```
    Uuid::generate()
```

- This will generate a version 1 with a random ganerated MAC address.

### Advanced Usage

[](#advanced-usage)

#### UUID creation

[](#uuid-creation)

##### UUID V1

[](#uuid-v1)

Generate a version 1, time-based, UUID. You can set the optional node to the MAC address. If not supplied it will generate a random MAC address.

```
Uuid::generate(1,'00:11:22:33:44:55');
```

##### UUID V3

[](#uuid-v3)

Generate a version 3, name-based using MD5 hashing, UUID

```
Uuid::generate(3,'test', Uuid::NS_DNS);
```

##### UUID V4

[](#uuid-v4)

Generate a version 4, truly random, UUID

```
Uuid::generate(4);
```

##### UUID V5

[](#uuid-v5)

Generate a version 5, name-based using SHA-1 hashing, UUID

```
Uuid::generate(5,'test', Uuid::NS_DNS);
```

### Additional Features

[](#additional-features)

###### Import UUID

[](#import-uuid)

- To import a UUID

```
$uuid = Uuid::import('d3d29d70-1d25-11e3-8591-034165a3a613');
```

###### Extract Time

[](#extract-time)

- Extract the time for a time-based UUID (version 1)

```
$uuid = Uuid::generate(1);
dd($uuid->time);
```

###### Extract Version

[](#extract-version)

- Extract the version of an UUID

```
$uuid = Uuid::generate(4);
dd($uuid->version);
```

### Changelog

[](#changelog)

##### 2.\*

[](#2)

- Laravel Uuid is now fully PSR-2, just like Laravel 5.1.
- Not that much has changed except for UPPERCASING the constants used in Laravel Uuid.
- Meaning `Uuid::nsDNS` is now `Uuid::NS_DNS` etc. Should be an easy fix.

### Credits

[](#credits)

- Full development credit must go to [webpatser](https://github.com/webpatser). This package was forked and modified to be compliant with [MIT](https://opensource.org/licenses/MIT) licensing standards for production use.

License
-------

[](#license)

Laravel UUID is licensed under the MIT license for both personal and commercial products. Enjoy!

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 82.6% 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 ~145 days

Recently: every ~121 days

Total

11

Last Release

3179d ago

Major Versions

1.5 → 2.02015-06-15

2.1.2 → v3.1.02017-09-04

PHP version history (2 changes)1.0PHP &gt;=5.3.0

v3.1.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/05cef7d9ee65723b129042943511207fb34db74a56afbf67b5900987f758c161?d=identicon)[jeremykenedy](/maintainers/jeremykenedy)

---

Top Contributors

[![jeremykenedy](https://avatars.githubusercontent.com/u/6244570?v=4)](https://github.com/jeremykenedy "jeremykenedy (19 commits)")[![rubicon-international](https://avatars.githubusercontent.com/u/24736813?v=4)](https://github.com/rubicon-international "rubicon-international (3 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

UUID RFC4122

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[wujunze/laravel-id-generate

Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in. and generate number id, generate primary key

134.4k](/packages/wujunze-laravel-id-generate)

PHPackages © 2026

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