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
Requires
- php: ~7.0
- illuminate/database: ~5.5
- illuminate/support: ~5.5
- ramsey/uuid: ~3.7
Requires (Dev)
- phpunit/phpunit: ^7.0
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: