brokeyourbike / uid-keys
A simple drop-in solution for providing UUID and ULID support for the IDs of your Eloquent models.
0.2.0
2026-01-02 00:43 UTC
Requires
- php: ^8.2
- laravel/framework: ^10.0|^11.0|^12.0
- symfony/uid: ^7.4
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8.3
- orchestra/testbench: *
- phpunit/phpunit: ^10
README
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
- Ivan Stasiuk | Twitter | LinkedIn | stasi.uk