jasonmccallister/laravel-uuid-as-id

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

Downloads

21

Stars

0

Version

v0.1.0

Use UUID as ID in Laravel

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.

jasonmccallister

Author

jasonmccallister