New

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

eig/eloquent-uuid

Easy UUID for Eloquent Models
1,785 59

Larablocks Analysis

eig/eloquent-uuid works with any PHP project: the latest release (3.0.0, Dec 8, 2022) doesn't depend on Laravel.

Laravel 5 in earlier releases.

Recommendation checks

Not advised

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

  • No release or commit in over 2 years
  • No release in the last 12 months (last: Dec 8, 2022)
  • 28 downloads a month (needs 10,000)
  • 59 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Dec 8, 2022.
  • No releases in the last 12 months.
  • First released: Feb 26, 2016.
  • Monthly downloads: 28, up 100% from six months ago.
  • 0 open issues on GitHub.

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

Install
composer require eig/eloquent-uuid
Latest Version:3.0.0
PHP:^8.0.2
Older releases:5
License:MIT
Last Updated:Dec 8, 2022
Links: GitHub  ·  Packagist
Maintainer: excellentingenuity

EloquentUUID

Build Status Latest Stable Version Coverage Status License StyleCI Total Downloads Latest Unstable Version

A Package for easily adding UUID's to Eloquent Models supporting Laravel 5.5+

Usage

To use UUID in an Eloquent Model install the package with:

composer require eig/eloquent-uuid

Then in your Model instead of extending Model extend EloquentUUID like so:

<?php

namespace App;

use eig\EloquentUUID\EloquentUUID;

class UUIDModel extends EloquentUUID
{

}

Then in your migrations make sure you set id to string or uuid like this:

public function up()
    {
        Schema::create('client_models', function (Blueprint $table) {
            $table->uuid('id');
            $table->softDeletes();
            $table->timestamps();
        });
    }

User UUID Model

For Laravel 5.3+, the standard user model that comes with the framework extends Authenticatble for the new multi-auth system. To add in UUID's to the user model extend eig\EloquentUUID\UUIDUser which will add in the UUID to the user while still extending Laravel's Authenticatable class. The migration schema changes for extending EloquentUUID are the same for extending from UUIDUser.

UUID Trait

As of version 1.1.0, EloquentUUID now has a trait named UUID in the namespace eig\EloquentUUID\Traits\UUID, that you can use to compose a UUID class. The trait implements a UUID assignment in a __constructor() method. The migration schema changes for extending EloquentUUID are the same for using the UUID trait.

Supported PHP Versions

Related Packages

ems/versatile

Extensions for Laravels Eloquent ORM

8,973 0
imcity-tech/laravel-uuid

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

1,694 0
hugorut/filterable

A laravel package for working with query filtering

20 0
rtablada/ordered-eloquent

An extension of Eloquent ORM for automatically ordering results

18 3
stevenmaguire/laravel-uuid-model

Create non-incrementing Laravel models whose primary key is a UUID

46 4

Version History

Version Released PHP Laravel License
3.0.0 ^8.0.2 MIT
2.4.1 >=7.2 MIT
2.4.0 >=7.2 MIT
2.2.0 >=7.2 MIT
2.1.0 >=7.1 MIT