New

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

gbuckingham89/eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.
5,022 1

Larablocks Analysis

gbuckingham89/eloquent-uuid works with Laravel 5 to 10 (latest release 3.5.0, Jul 21, 2023), all past end of life (the last on Feb 4, 2025): no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5 to 10, past end of life since Feb 4, 2025
  • No release in the last 12 months (last: Jul 21, 2023)
  • 128 downloads a month (needs 10,000)
  • 1 GitHub star (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jul 21, 2023.
  • No releases in the last 12 months.
  • First released: Jan 25, 2017.
  • Monthly downloads: 128, up 4167% from six months ago.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require gbuckingham89/eloquent-uuid
Latest Version:3.5.0
PHP:^7.1|^8.0
Laravel:5 – 10
License:MIT
Last Updated:Jul 21, 2023
Links: GitHub  ·  Packagist
Maintainer: gbuckingham89

gbuckingham89/eloquent-uuid v3

A simple package for using UUID's with Laravel's Eloquent models. By including the trait on your models, they will automatically get given a time ordered UUIDv4 for their key (ID) when being persisted to the database.

The current version requires Laravel 5.6 (PHP 7.1) or greater. If you're using an older version of Laravel, please see v1 of this package.

Installation

composer require gbuckingham89/eloquent-uuid

Use

Make sure your database table(s) are setup to handle UUID's. Laravel has a method called uuid() which you can use in your migrations. You will probably want the field to be unique too.

Schema::create('users', function (Blueprint $table) {
    $table->uuid('id')->unique();
    // Other fields here...
});

At the top of your model(s) you simply need to include a trait:

<?php

namespace App;
use Gbuckingham89\EloquentUuid\Traits\UuidForKey;
use Illuminate\Database\Eloquent\Model;

class User extends Eloquent
{
    use UuidForKey;
}

Code and documentation copyright George Buckingham.

Code released under the MIT License.

Related Packages

brokeyourbike/uid-keys

A simple drop-in solution for providing UUID and ULID support for the IDs of you...

1,696 0
imcity-tech/laravel-uuid

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

1,694 0
simlux/laravel-model-uuid

Make usage of UUID in laravel models easy.

130 0
tysdever/eloquent-attachment

Attaching files into modle

21 0
cline/morphism

Reusable polymorphic key mapping for Laravel packages

27,678 0

Version History

Version Released PHP Laravel License
3.5.0 ^7.1|^8.0 ^5.6|^5.7|^5.8|^6.0|^7.0|^8.0|^9.0|^10.0 MIT
3.4.0 ^7.1|^8.0 ^5.6|^5.7|^5.8|^6.0|^7.0|^8.0|^9.0 MIT
3.3.0 ^7.1|^8.0 ^5.6|^5.7|^5.8|^6.0|^7.0|^8.0 MIT
3.2.0 ^7.1 ^5.6|^5.7|^5.8|^6.0|^7.0|^8.0 MIT
3.1.0 ^7.1 ^5.6|^5.7|^5.8|^6.0|^7.0 MIT