New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

marquine/eloquent-uuid

Uuid primary key for Laravel Eloquent Models
11,534 7
Install
composer require marquine/eloquent-uuid
Latest Version:v1.2.0
Laravel:5 · 6 · 7
License:MIT
Last Updated:Mar 11, 2020
Links: GitHub  ·  Packagist
Maintainer: leomarquine

Eloquent UUID

Uuid primary key for Laravel Eloquent Models.

Installation

Install through Composer

composer require marquine/eloquent-uuid

Usage

Database table

In your migration, create a column for the uuid primary key:

$table->uuid('id')->primary();

or

$table->string('id', 32)->primary();

If your primary key column name is not id, you need to set the model's $primaryKey property to the correct name.

Model

Use the Uuid trait in your model:

<?php

namespace App;

use Marquine\EloquentUuid\Uuid;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use Uuid;
}

License

Eloquent UUID is licensed under the MIT license.

Related Packages

stayallive/laravel-eloquent-uuid

Generate UUID for a Laravel Eloquent model attribute.

71,246 4
theprivateer/eloquent-uuid

UUID utility traits for Laravel

7,181 1
imcity-tech/laravel-uuid

[fork] The package provides UUID keys functionality for Eloquent models with one...

1,687 0
dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

3,461,862 483
goldspecdigital/laravel-eloquent-uuid

A simple drop-in solution for providing UUID support for the IDs of your Eloquen...

1,397,276 505

Version History

Version Released Laravel License
v1.2.0 ^5.0|^6.0|^7.0 MIT
v1.1.1 ^5.0|^6.0 MIT
v1.1.0 ^5.0|^6.0 MIT
v1.0.2 ^5.0.0 MIT
v1.0.1 ^5.0.0 MIT