2017 © Pedro Peláez
 

library eloquent-uuid

Easy UUID for Eloquent Models

image

eig/eloquent-uuid

Easy UUID for Eloquent Models

  • Thursday, August 3, 2017
  • by excellentingenuity
  • Repository
  • 2 Watchers
  • 64 Stars
  • 455 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

EloquentUUID

Build Status Latest Stable Version Coverage Status License StyleCI Total Downloads Latest Unstable Version, (*1)

A Package for easily adding UUID's to Eloquent Models supporting Laravel 5.5+, (*2)

Usage

To use UUID in an Eloquent Model install the package with:, (*3)

composer require eig/eloquent-uuid

Then in your Model instead of extending Model extend EloquentUUID like so:, (*4)

<?php

namespace App;

use eig\EloquentUUID\EloquentUUID;

class UUIDModel extends EloquentUUID
{

}

Then in your migrations make sure you set id to string or uuid like this:, (*5)

public function up()
    {
        Schema::create('client_models', function (Blueprint $table) {
            $table->uuid('id');
            $table->softDeletes();
            $table->timestamps();
        });
    }

User UUID Model

For Laravel 5.3+, the standard user model that comes with the framework extends Authenticatble for the new multi-auth system. To add in UUID's to the user model extend eig\EloquentUUID\UUIDUser which will add in the UUID to the user while still extending Laravel's Authenticatable class. The migration schema changes for extending EloquentUUID are the same for extending from UUIDUser., (*6)

UUID Trait

As of version 1.1.0, EloquentUUID now has a trait named UUID in the namespace eig\EloquentUUID\Traits\UUID, that you can use to compose a UUID class. The trait implements a UUID assignment in a __constructor() method. The migration schema changes for extending EloquentUUID are the same for using the UUID trait., (*7)

Supported PHP Versions

The Versions

03/08 2017

dev-master

9999999-dev https://github.com/excellentingenuity/EloquentUUID

Easy UUID for Eloquent Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by James Johnson

orm laravel uuid eloquent

03/08 2017

2.0.0

2.0.0.0 https://github.com/excellentingenuity/EloquentUUID

Easy UUID for Eloquent Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by James Johnson

orm laravel uuid eloquent

03/08 2017

dev-dev

dev-dev https://github.com/excellentingenuity/EloquentUUID

Easy UUID for Eloquent Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by James Johnson

orm laravel uuid eloquent

03/08 2017

dev-1x

dev-1x https://github.com/excellentingenuity/EloquentUUID

Easy UUID for Eloquent Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by James Johnson

orm laravel uuid eloquent

03/08 2017

1.1.1

1.1.1.0 https://github.com/excellentingenuity/EloquentUUID

Easy UUID for Eloquent Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by James Johnson

orm laravel uuid eloquent

23/11 2016
23/11 2016

dev-analysis-X0bAJ4

dev-analysis-X0bAJ4 https://github.com/excellentingenuity/EloquentUUID

Easy UUID for Eloquent Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by James Johnson

orm laravel uuid eloquent