xzxzyzyz/laravel-uuid-model
Add UUID primary key support to Laravel Eloquent models. This package helps replace auto-incrementing IDs with universally unique identifiers, useful for distributed systems, public-facing IDs, and safer record references, while keeping model integration simple.
Architecture fit
HasUuids / HasUniqueStringIds (Laravel 9+), so the package only earns its place if it adds something the framework does not: ordered UUIDs (v6/v7), binary(16) storage, per-model key configuration, or migration/stub helpers.Integration feasibility
getKeyType, getIncrementing, whereKey, JSON serialization, and route model binding correctly.Technical risk
Key questions
HasUuids does not? Specifically: UUID version (v4 vs v7), storage type (char(36) vs binary(16)), and index strategy?Stack fit
Migration path
uuid column with unique index) on new and high-exposure tables, keeping the integer PK internal. This captures the external-facing benefit without touching referential integrity.Compatibility
find(), findOrFail(), route binding, toArray()/JSON, whereKey, updateOrCreate, and belongsTo/belongsToMany hydration.php artisan migrate:fresh, rollback, and model factories — UUID packages frequently break factory create() flows or model replication.Sequencing
HasUuids.Maintenance
Support
Scaling
BIGINT. Ordered UUIDs (v7) or binary(16) storage largely neutralize this; char(36) storage does not.Failure modes
composer install in CI; mitigated by vendoring or a private mirror.Ramp-up
HasUuids.How can I help you explore Laravel packages today?