sevenshores / eloquent-uuids by ryanwinchester

Laravel Eloquent Models Uuids
17
1
3
Package Data
Maintainer Username: ryanwinchester
Maintainer Contact: fungku@gmail.com (Ryan Winchester)
Package Create Date: 2016-10-07
Package Last Update: 2016-10-07
Language: PHP
License: Apache-2.0
Last Refreshed: 2024-11-11 15:12:31
Package Statistics
Total Downloads: 17
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Laravel Eloquent Uuids

To use it just install

composer require sevenshores/eloquent-uuids

then in you model you can do:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use SevenShores\Uuids\Uuids;

class Post extends Model
{
    use Uuids;

    public $incrementing = false;

    // . . .
}

Don't forget, in your migration for your model, for id field you should use:

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

Note:

I know I've seen a similar package to this in the past, but I don't remember where, and don't care to look for it, because I'd rather just make my own for my own use.