healthengine/laravel-uuid
A small Laravel package for using UUIDs with Eloquent models. It helps generate UUID primary keys automatically and integrate UUID-backed models into your app with minimal setup, making it easier to add collision-resistant identifiers to Laravel projects.
HasUuids/HasUniqueStringIds traits vs. ~40 lines of in-house trait. Given the package's status, the build side of that equation is genuinely cheap — this is a pattern decision, not a procurement one.$incrementing/$keyType/$keyType boilerplate handled in one place.Consider it only in a narrow, well-understood situation:
HasUuids does not exist, and you want a working reference implementation of UUID primary keys for Eloquent rather than writing the trait yourself.Look elsewhere — i.e., treat this as not adoptable as a dependency — when any of the following hold:
HasUuids trait and uuid/ulid migration column types. Zero third-party risk, actively maintained, same semantics.For executives (one paragraph): We need a decision on identifier strategy — whether records are keyed by sequential numbers or globally unique IDs — because it shapes our API contracts, data-merging options, and privacy posture for years. This specific package is not something I recommend we take on as a dependency: it was published by a company as an internal utility, has a single star, no downstream users, no release since 2020, and is archived. The good news is the decision is cheap to act on — the modern Laravel framework ships this capability natively, so we can make the product-level call on identifier strategy without adding third-party risk, and without meaningful engineering cost.
For engineering: Treat this repository as a reference implementation and nothing more. Its value is that it shows, in a few dozen lines, exactly what Eloquent requires for non-incrementing string keys: $incrementing = false, $keyType = 'string', key generation in the model's boot method, and the route-binding implications. Do not add it to composer.json. Use HasUuids/HasUniqueStringIds on Laravel 9+, or lift the pattern into a first-party trait we own. If we do adopt UUID keys, agree up front on UUIDv7/ULID for index locality, binary storage where the database supports it, and the migration path for existing integer-keyed tables.
Recommendation: Reject as a dependency. Adopt the pattern via framework-native traits; retain this package only as a citation in our design notes.
How can I help you explore Laravel packages today?