brokeyourbike / uid-keys
A simple drop-in solution for providing UUID and ULID support for the IDs of your Eloquent models.
                                    Fund package maintenance!
                                                                            
                                                                                                                                        brokeyourbike
                                                                                    
                                                                            
                                                                                                                                        Open Collective
                                                                                    
                                                                
Installs: 1 527
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/brokeyourbike/uid-keys
Requires
- php: ^8.1
 - laravel/framework: ^8.0|^9.0
 - symfony/uid: ^6.0
 
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
 - orchestra/testbench: ^6
 - phpunit/phpunit: ^9.5
 
This package is auto-updated.
Last update: 2025-10-20 17:08:10 UTC
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