New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

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.
143,167 23

Larablocks Analysis

jeremykenedy/uuid works with any PHP project: the latest release (v3.1.0, Sep 4, 2017) doesn't depend on Laravel.

Recommendation checks

Use with care

Use with care: meets 0 of 3 checks.

  • No release in the last 12 months (last: Sep 4, 2017)
  • 2,206 downloads a month (needs 10,000)
  • 23 GitHub stars (needs 100)

State

Quiet
  • Last stable release: Sep 4, 2017.
  • No releases in the last 12 months.
  • First released: Sep 14, 2013.
  • Monthly downloads: 2,206, up 212% from six months ago.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require jeremykenedy/uuid
Latest Version:v3.1.0
PHP:>=7.0.0
License:MIT
Last Updated:Oct 8, 2026
Links: GitHub  ·  Packagist
Maintainer: jeremykenedy

Laravel Uuid (Universally unique identifier)

Total Downloads StyleCI Build Status Latest Stable Version License: 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

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

Installation

Laravel 5.5 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
  1. From your projects root folder in terminal run:
    composer require jeremykenedy/uuid:2.1.2
  1. Register the package with laravel in config/app.php under aliases with the following:
    'aliases' => [
        'Uuid' => jeremykenedy\Uuid\Uuid::class,
    ];

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

UUID creation
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

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

Uuid::generate(3,'test', Uuid::NS_DNS);
UUID V4

Generate a version 4, truly random, UUID

Uuid::generate(4);
UUID V5

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

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

Additional Features

Import UUID
  • To import a UUID
$uuid = Uuid::import('d3d29d70-1d25-11e3-8591-034165a3a613');
Extract Time
  • Extract the time for a time-based UUID (version 1)
$uuid = Uuid::generate(1);
dd($uuid->time);
Extract Version
  • Extract the version of an UUID
$uuid = Uuid::generate(4);
dd($uuid->version);

Changelog

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

  • Full development credit must go to webpatser. This package was forked and modified to be compliant with MIT licensing standards for production use.

License

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

Related Packages

wujunze/laravel-id-generate

Laravel package to generate and to validate a UUID according to the RFC 4122 sta...

4,413 13
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607

Version History

Version Released PHP License
v3.1.0 >=7.0.0 MIT
2.1.2 >=5.3.0 MIT
2.1.1 >=5.3.0 MIT
2.1.0 >=5.3.0 MIT
2.0.1 >=5.3.0 MIT