brokeyourbike/uid-keys

A simple drop-in solution for providing UUID and ULID support for the IDs of your Eloquent models.

Maintainers

Package info

github.com/brokeyourbike/uid-keys-laravel

pkg:composer/brokeyourbike/uid-keys

Fund package maintenance!

brokeyourbike

Open Collective

Statistics

Installs: 1 578

Dependents: 1

Suggesters: 0

Stars: 0

0.2.0 2026-01-02 00:43 UTC

This package is auto-updated.

Last update: 2026-03-02 01:01:32 UTC


README

Latest Stable Version Total Downloads codecov

A simple drop-in solution for providing UUID and ULID support for the IDs of your Eloquent models.

Installation

composer require brokeyourbike/uid-keys

Usage

use Illuminate\Database\Eloquent\Model;
use BrokeYourBike\UidKeys\Database\Eloquent\Ulid;

class ExampleModel extends Model
{
    use Ulid;

    /**
     * The "type" of the auto-incrementing ID.
     *
     * @var string
     */
    protected $keyType = 'string';

    /**
     * Indicates if the IDs are auto-incrementing.
     *
     * @var bool
     */
    public $incrementing = false;
}

Inspiration

Code mainly stolen from the goldspecdigital/laravel-eloquent-uuid package.

Authors

License

Mozilla Public License v2.0