sevenshores / eloquent-uuids
Laravel Eloquent Models Uuids
dev-master
2016-10-07 03:59 UTC
Requires
- ramsey/uuid: ^3.5
This package is not auto-updated.
Last update: 2024-11-09 19:56:35 UTC
README
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.