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

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

cloudcake/laravel-uuid
======================

UUID's for Laravel's Eloquent models.

v1.5(6y ago)1131[1 PRs](https://github.com/cloudcake/laravel-uuid/pulls)MITPHPPHP &gt;=7.0.0

Since Aug 3Pushed 2y agoCompare

[ Source](https://github.com/cloudcake/laravel-uuid)[ Packagist](https://packagist.org/packages/cloudcake/laravel-uuid)[ RSS](/packages/cloudcake-laravel-uuid/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

Heads up!
=========

[](#heads-up)

Since Laravel 9.x, UUID support for Eloquent is baked right into Laravel.
See [Illuminate/Database/Eloquent/Concerns/HasUuids](https://laravel.com/api/master/Illuminate/Database/Eloquent/Concerns/HasUuids.html).

This package is now redundant.

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

[](#installation)

Install via composer using `composer require cloudcake/laravel-uuid`

Usage
-----

[](#usage)

### Primary Key UUID's

[](#primary-key-uuids)

If you want to use UUID's as your model's primary key, this is for you.

- Add the `Uuid\Traits\UuidPrimaryKey` trait to the eloquent model
- Add the primary key column name if you're not using the default of `id` (Optional)

```
use Uuid\Traits\UuidPrimaryKey;

class User extends Authenticatable
{
    use UuidPrimaryKey;

    protected $primaryKey = 'id';
}
```

Now you'll be able to call `User::find('');`.

### Additional Field UUID's

[](#additional-field-uuids)

In some situations you may want to retain your regular integer based primary key, but add an additional UUID column to your models, for this case, use the `Uuid` trait.

- Add the `Uuid\Traits\Uuid` trait to the eloquent model
- Add the name of the UUID column

```
use Uuid\Traits\Uuid;

class User extends Authenticatable
{
    use Uuid;

    protected static $uuidKeyName = 'uuid';
}
```

And query it as you would any other attribute, `User::where('uuid', '')->first()`.

Additional Options
------------------

[](#additional-options)

Add any/all of the following to your model(s) to fine-tune the package to your needs.

AttributeDescription$uuidKeyThe name of the UUID column in the database. Defaults to `uuid`.$uuidOrderedWhether or not the UUID should use timestamp ordering. Defaults to `true`.Example:

```
use Uuid\Traits\Uuid;
use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    use Uuid;

    /**
     * The name of the UUID column in the database.
     *
     * @var string
     */
    protected static $uuidKey = 'universally_unique_id';

    /**
     * Whether or not the UUID should use timestamp ordering.
     *
     * @var bool
     */
    protected static $uuidOrdered = true;
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Total

6

Last Release

2225d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1300442?v=4)[Stephen Lake](/maintainers/stephenlake)[@stephenlake](https://github.com/stephenlake)

---

Top Contributors

[![stephenlake](https://avatars.githubusercontent.com/u/1300442?v=4)](https://github.com/stephenlake "stephenlake (14 commits)")

---

Tags

laraveluuid

### Embed Badge

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

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

###  Alternatives

[webpatser/laravel-uuid

Laravel integration for webpatser/uuid - High-performance drop-in UUID replacements (15% faster than Ramsey). Provides Str macros, HasUuids trait, facades, and casts. RFC 4122/9562 compliant.

1.8k17.3M129](/packages/webpatser-laravel-uuid)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[madewithlove/laravel-nova-uuid-support

Adds uuid and other string identifier support to Laravel Nova

28132.9k](/packages/madewithlove-laravel-nova-uuid-support)[riipandi/laravel-optikey

Use UUID, Ulid, or nanoid as optional or primary key in Laravel.

429.1k](/packages/riipandi-laravel-optikey)[elfsundae/laravel-hashid-uuid

Shorten UUID encoding for Laravel Hashid.

132.5k](/packages/elfsundae-laravel-hashid-uuid)

PHPackages © 2026

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