jasonmccallister/laravel-uuid-as-id

Simple Laravel package that includes a trait for using UUIDs and IDs on Eloquent models

v0.1.0 2019-05-14 00:22 UTC

This package is auto-updated.

Last update: 2024-11-14 13:59:03 UTC


README

Latest Version on Packagist Total Downloads

This is a simple trait that will override the key on an eloquent model to create a UUID instead of an integer.

Installation

You can install the package via composer:

composer require jasonmccallister/laravel-uuid-as-id

Usage

Update your models to use the trait, and you are done!

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use JasonMcCallister\UuidAsId\Traits\UuidAsId;

class SomeModel extends Model
{
    use UuidAsId;

    // the rest of your model's code
}

Testing

composer test

Credits

License

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