iotekas / uuids
UUID for Laravel
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/iotekas/uuids
Requires
- php: ~5.6|~7.0
- illuminate/support: ^5
- ramsey/uuid: ^3
This package is auto-updated.
Last update: 2025-12-15 04:00:13 UTC
README
Use this package to use uuid as primary key on your model.
The package creates UUID-4 keys from the ramsey/uuid package, and automatically assigns the key to the $id field. This is a simple package with almost no configuration. There are more advanced packages out there ex.: https://github.com/spatie/laravel-binary-uuid
<?php use iotek\UsesUuid\Uuids; class YourModel extends Model { use Uuids;
You will also need to edit your migration. The 'id' column shall be set to uuid or string. On a fresh laravel you only
$table->uuid('id')->primary(); // OR $table->string('id')->primary();