Looking to hire Laravel developers? Try LaraJobs

laravel-uuid maintained by devkylian

Description
Eloquent UUID Trait for Laravel 6 and above.
Author
Last update
2023/10/06 20:59 (dev-master)
License
Links
Downloads
118

Comments
comments powered by Disqus

Laravel-Uuid

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;
}