edersoares/eloquent-uuid

This package is abandoned and no longer maintained. No replacement package was suggested.

A simple package to use universally unique identifiers (UUID) in Eloquent models.

dev-master 2018-03-12 23:23 UTC

This package is auto-updated.

Last update: 2023-03-26 09:32:54 UTC


README

A simple package to use universally unique identifiers (UUID) as primary key of the Eloquent models.

This package uses Uuid library utilized in Laravel Framework to generate UUIDs.

Installation

composer require edersoares/eloquent-uuid

Usage

  • Replace in migrations files:
// From
$table->increments('id');

// To
$table->uuid('uuid')->unique();
$table->primary('uuid')
  • After, use in your model the Nix\Eloquent\Uuid\Uuid trait:
use Illuminate\Database\Eloquent\Model;
use Nix\Eloquent\Uuid\Uuid;

class SomeModel extends Model
{
    use Uuid;
}

Credits

This package uses:

And is based on: