juniorb2ss/eloquent-uuid
Eloquent UUID adds UUID support to Laravel's Eloquent models, letting you use universally unique identifiers as primary keys with minimal configuration. Useful for distributed apps or anywhere non-sequential IDs are preferred.
/orders/1001, /orders/1002) and let you hand out identifiers to partners, webhooks, and mobile clients without leaking volume or growth rate.HasUuids / HasUlids natively (9.x+), the honest output of this evaluation is usually "use the framework, not this package" — but it's cheap to benchmark.Consider it when:
HasUuids, and you want a drop-in trait rather than hand-rolling boot() logic for $incrementing = false and $keyType = 'string'.app/Support if the maintainer disappears.Look elsewhere when:
HasUuids trait (or HasUlids if index locality matters). No third-party dependency, no version-drift risk, same outcome.Str::orderedUuid()). Random v4 UUIDs fragment InnoDB primary-key indexes and hurt write throughput on high-volume tables; that's a real product-level cost at scale.public_id) while retaining integer primary keys — usually the safer pattern, and outside this package's scope.ramsey/uuid directly (already a Laravel dependency).To executives: There's a small open-source helper that lets our Laravel models use UUIDs as IDs instead of sequential numbers. The business reason to care is exposure and scale: UUIDs stop outsiders from guessing how many customers or orders we have, and they let us merge data across systems without ID collisions. Cost is effectively zero and the license is permissive. The caveat is maturity — this specific package has almost no adoption (3 stars, no dependent projects), and the framework now ships this capability natively. Recommendation: do not adopt it as a dependency. Fund a short spike to confirm native UUID support meets our needs, and standardize on the framework feature. Net cost: a few engineering hours, no vendor risk, no new dependency to maintain.
To engineering: It's a trait that flips a model to string keys and generates a v4 UUID on create. If we're on Laravel 9+, HasUuids does the same thing with no supply-chain surface — prefer that. Be explicit about the tradeoffs before we commit at the schema level: v4 UUIDs are random, so clustered-index insert performance degrades on write-heavy tables; consider HasUlids or ordered UUIDs there. Plan for 36-char char(36) or binary(16) columns, matching types on every foreign key, and route-model-binding behavior. If we do pull this package in for a legacy branch, pin it, vendor it if the logic is trivial, and add a test asserting key generation on model creation so a silent break is caught.
How can I help you explore Laravel packages today?