brokeyourbike/uid-keys

A simple drop-in solution for providing UUID and ULID support for the IDs of your Eloquent models.
1,578
Install
composer require brokeyourbike/uid-keys
Latest Version:0.2.0
PHP:^8.2
License:MPL-2.0
Last Updated:Jan 2, 2026
Links: GitHub  ·  Packagist
Maintainer: brokeyourbike

uid-keys

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

Related Packages

cline/morphism

Reusable polymorphic key mapping for Laravel packages

20,984 0
cline/strongly-typed-id

Strongly-typed ID value objects for PHP with support for UUID, ULID, NanoID, GUI...

8,933 0
gbuckingham89/eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.

4,787 1
lingfengchencn/eloquent-uuid-for-key

uuid4 key for laravel's eloquent

25 1
goldspecdigital/laravel-eloquent-uuid

A simple drop-in solution for providing UUID support for the IDs of your Eloquen...

1,375,431 506