devkylian/laravel-uuid

Eloquent UUID Trait for Laravel 6 and above.

Installs: 118

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:plugin

pkg:composer/devkylian/laravel-uuid

dev-master 2023-10-06 18:59 UTC

This package is auto-updated.

Last update: 2025-12-07 00:23:24 UTC


README

Eloquent UUID Trait for Laravel 6 and above.

Installation

composer require devkylian/laravel-uuid

Usage

Add this in your migrations

Schema::create('users', function (Blueprint $table) {
    $table->uuid('id')->primary();
    $table->string('username');
    $table->string('email')->unique();
    $table->string('password');
    $table->rememberToken();
    $table->timestamps();
});

Add this in your models

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use DevKylian\Uuid\HasUuid;

class User extends Model
{
    use HasUuid;
}