2017 © Pedro Peláez
 

library eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.

image

gbuckingham89/eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.

  • Friday, April 6, 2018
  • by gbuckingham89
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,167 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 27 % Grown

The README.md

gbuckingham89/eloquent-uuid v3

A simple package for using UUID's with Laravel's Eloquent models. By including the trait on your models, they will automatically get given a time ordered UUIDv4 for their key (ID) when being persisted to the database., (*1)

The current version requires Laravel 5.6 (PHP 7.1) or greater. If you're using an older version of Laravel, please see v1 of this package., (*2)

Installation

composer require gbuckingham89/eloquent-uuid

Use

Make sure your database table(s) are setup to handle UUID's. Laravel has a method called uuid() which you can use in your migrations. You will probably want the field to be unique too., (*3)

Schema::create('users', function (Blueprint $table) {
    $table->uuid('id')->unique();
    // Other fields here...
});

At the top of your model(s) you simply need to include a trait:, (*4)

<?php

namespace App;
use Gbuckingham89\EloquentUuid\Traits\UuidForKey;
use Illuminate\Database\Eloquent\Model;

class User extends Eloquent
{
    use UuidForKey;
}

Code and documentation copyright George Buckingham., (*5)

Code released under the MIT License., (*6)

The Versions

06/04 2018

dev-master

9999999-dev https://github.com/gbuckingham89/eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.

  Sources   Download

MIT

The Requires

 

laravel php uuid eloquent

06/04 2018

2.0.0

2.0.0.0 https://github.com/gbuckingham89/eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.

  Sources   Download

MIT

The Requires

 

laravel php uuid eloquent

06/04 2018

1.0.1

1.0.1.0 https://github.com/gbuckingham89/eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.

  Sources   Download

MIT

The Requires

 

laravel php uuid eloquent

25/01 2017

1.0.0

1.0.0.0 https://github.com/gbuckingham89/eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.

  Sources   Download

MIT

The Requires

 

laravel php uuid eloquent