rits-tecnologia/laravel-model-uuid

Laravel Model UUID

Maintainers

Package info

github.com/rits-tecnologia/laravel-model-uuid

pkg:composer/rits-tecnologia/laravel-model-uuid

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2022-01-28 17:27 UTC

This package is auto-updated.

Last update: 2026-03-29 00:59:01 UTC


README

This package provides UUID automatic generation for Laravel Models.

Installation

Install this package with composer.

composer require rits-tecnologia/laravel-model-uuid

Usage

Change your migration primary key

// change this
$table->id();

// to this
$table->uuid('id')->primary();

Add trait to your model

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use GeneratesUuid;
}