bmatovu/laravel-eloquent-uuid
A Laravel package that adds UUID support to Eloquent models, letting you use universally unique identifiers as primary keys instead of auto-incrementing integers. It handles key generation and configuration for UUID-based models.
Architecture fit
HasUuids (and HasUniqueStringIds in 11+), which covers the same ground with framework-maintained code. For any project on Laravel 9 or later, this package adds a dependency without adding capability.Integration feasibility
Technical risk
Key questions
ramsey/uuid vs Str::uuid())?$incrementing = false, $keyType = 'string', and generate the key on the creating event?HasUuids or custom getKey() behavior?Signal read: 3 stars, 0 dependents, archived, composite score 0.0075 against an opportunity score of 11.87. The gap says the problem space (UUID primary keys in Eloquent) is valuable; this implementation is not the vehicle. Treat the repository as reference code, not a dependency.
Stack fit
Migration path
HasUuids. Zero dependency, framework-supported, upgrade-safe.app/Models/Concerns/ under your own namespace. MIT permits this; you inherit maintenance but gain control and can add UUIDv7 support.If the codebase already depends on the package, the migration is mechanical: replace the trait import, delete $incrementing/$keyType overrides if the native trait handles them, run the test suite, and drop the dependency.
Compatibility
char(36) versus native uuid versus binary(16). Mismatches surface as join failures, not as install errors.Sequencing
Maintenance
Support
Scaling
char(36) costs ~2.25× a binary(16) representation per key, multiplied across primary keys and every foreign-key column that references them.Failure modes
getKey() inconsistencies.Ramp-up
HasUuids, or vendor the ~50 lines if Laravel 8/9 compatibility forces the issue, and close the dependency out.How can I help you explore Laravel packages today?