laravel-uuid-as-id maintained by jasonmccallister
Description
Simple Laravel package that includes a trait for using UUIDs and IDs on Eloquent models
Author
Last update
2019/05/14 02:30
(dev-master)
License
Downloads
24
Tags
Use UUID as ID in Laravel
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.