New

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

kduma/eloquent-uuidable

Eloquent Uuidable Trait
1,006
Install
composer require kduma/eloquent-uuidable
Latest Version:v3.0.0
PHP:^8.3
Laravel:13
License:MIT
Last Updated:Apr 8, 2026
Links: GitHub  ·  Packagist
Maintainer: kduma

Eloquent UUID-able

Latest Stable Version Total Downloads License

Eloquent trait that adds a UUID as an additional column alongside the numeric id in Laravel models.

Full documentation: opensource.duma.sh/libraries/php/eloquent-uuidable

Requirements

  • PHP ^8.3
  • Laravel ^13.0

Installation

composer require kduma/eloquent-uuidable

Usage

use KDuma\Eloquent\Uuidable;
use KDuma\Eloquent\Attributes\HasUuid;

#[HasUuid(field: 'uuid')]
class User extends Model
{
    use Uuidable;
}

Add a uuid column to your migration:

$table->uuid('uuid')->unique();

UUID is auto-generated on create. Find by UUID with User::whereUuid($uuid) or User::byUuid($uuid).

Unlike Laravel's built-in HasUuids, this package keeps the numeric id as the primary key and stores the UUID in a separate column.

Related Packages

gstjohn/eloquent-uuids

Easily allow Laravel Eloquent models to utilize UUIDs as their primary key.

6 0
stayallive/laravel-eloquent-uuid

Generate UUID for a Laravel Eloquent model attribute.

71,246 4
marquine/eloquent-uuid

Uuid primary key for Laravel Eloquent Models

11,534 7
theprivateer/eloquent-uuid

UUID utility traits for Laravel

7,181 1
imcity-tech/laravel-uuid

[fork] The package provides UUID keys functionality for Eloquent models with one...

1,684 0

Version History

Version Released PHP Laravel License
v3.0.0 ^8.3 ^13.0 MIT
v1.0.1 >=5.4.0 MIT
v1.0 >=5.4.0 MIT