darkmodeee/laravel-uuid is a Laravel package for eloquent uuid trait for laravel 6 and above..
It currently has 1 GitHub stars and 5 downloads on Packagist (latest version 2.0.0).
Install it with composer require darkmodeee/laravel-uuid.
Discover more Laravel packages by darkmodeee
or browse all Laravel packages to compare alternatives.
Last updated
Eloquent UUID Trait for Laravel 5.7 and above.
The HasUuid Trait will add behavior to creating and saving Eloquent events for generate an Uuid.
composer require jamesh/laravel-uuid
Schema::create('users', function (Blueprint $table) {
$table->uuid('id')->primary(); // Create CHAR(36)
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Jamesh\Uuid\HasUuid;
class User extends Model
{
use HasUuid;
}
To run the tests, just run composer install and composer test.