New

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

juniorb2ss/eloquent-uuid

Trait to implement UUID in Eloquent ORM
7,168 3

Larablocks Analysis

juniorb2ss/eloquent-uuid works with Laravel 4 and 5 (latest release 1.0.1, Aug 8, 2017), all past end of life: 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 4 and 5, past end of life
  • No release in the last 12 months (last: Aug 8, 2017)
  • 0 downloads a month (needs 10,000)
  • 3 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Aug 8, 2017.
  • No releases in the last 12 months.
  • First released: Aug 7, 2017.
  • 1 open issue on GitHub.

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

Install
composer require juniorb2ss/eloquent-uuid
Latest Version:1.0.1
PHP:^7.0
Laravel:4 · 5
License:MIT
Last Updated:Apr 29, 2021
Links: GitHub  ·  Packagist
Maintainer: juniorb2s

Eloquent UUID Trait

Build Status Code Coverage Laravel Scrutinizer Code Quality StyleCI Code Climate

The juniorb2ss/eloquent-uuid provider a simple trait to implement UUID to ORM.

Install

You can install this package via composer:

$ composer require juniorb2ss/eloquent-uuid~1.*

Eloquent Trait

use juniorb2ss\EloquentUuid\EloquentUuidTrait;

class User extends Authenticatable
{
    use Notifiable, EloquentUuidTrait;
    
    /**
    * UUID Column name used
    * 
    * @var string
    * @optional 
    */
    protected $uuidKey = 'uuid';
}

UUID Column

You need create new column in table model like uuid or custom name you can define in uuidKey model property

Example

$fields = $request->only(['email', 'name', 'password']);
$user = User::create($fields); // Creating user with auto-inject uuid field

dump($user->toArray());

/*[
    "id" => "1"
    "uuid" => "723e4628-7c35-11e7-89b1-0242bfc0df57",
    "name" => "Magdalena Zboncak"
    "email" => "nitzsche.katherine@gulgowski.com"  
  ]*/

Scope On UUID

use App\User;

$user = (new User)->onUuid('aae5f3f1-0f22-4a8b-9291-d2a9649d1490')
                  ->firstOrFail();

Tests

composer run test

Change log

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

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
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released PHP Laravel License
1.0.1 ^7.0 ~4|~5 MIT
1.0 ^7.0 ~4|~5 MIT