iotekas/uuids

There is no license information available for the latest version (dev-master) of this package.

UUID for Laravel

Maintainers

Details

github.com/iotekas/uuids

Source

Issues

Installs: 28

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/iotekas/uuids

dev-master 2020-08-14 16:16 UTC

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();