jamesh/laravel-uuid
Adds UUID primary keys to Laravel Eloquent models. A lightweight trait generates a UUID on creation, supports lookups by UUID, and makes models route-key ready, so you can replace auto-incrementing IDs without rewriting your queries or controllers.
Str::uuid() since Laravel 5.6, HasUuids/HasUniqueStringIds since Laravel 9). The real decision is "native trait vs. third-party trait," and this package is on the losing side of that comparison for any modern Laravel version.Consider only if:
Look elsewhere if any of the following hold — which covers almost every real scenario:
HasUuids trait. First-party, tested against every release, no dependency risk.Str::uuid() in a booted() model hook or a local trait. Trivial to write, trivial to review.ramsey/uuid, symfony/uid, or the framework's ULID support. This package does not address ordering or index-fragmentation concerns.To executives: Recommend against adoption. The capability — UUID primary keys in Laravel — is now built into the framework, so paying any dependency cost (review time, upgrade friction, security surface) buys us nothing. The package is archived, has no downstream users we can point to, and has not been updated since early 2022, which means it will silently rot against future Laravel releases. The cheapest and safest path is to use the framework's native UUID support and spend the saved effort on the migration and indexing work that actually differentiates the product. Framing: this is a "do not add a dependency" decision, not a feature trade-off.
To engineering: This is a thin Eloquent trait wrapping UUID generation — roughly the same surface area as the code we would write ourselves in one sitting. The repository is archived with zero dependents, so there is no community patch path and no signal of production hardening. For Laravel 9+ we should use HasUuids; for anything older, a local trait using Str::uuid() gives us identical behavior with full control and no supply-chain exposure. If a team member believes there is a specific behavior in this package we cannot replicate, that is worth a 30-minute spike — but the default should be native or in-house, and the decision should be documented so it does not get re-litigated.
How can I help you explore Laravel packages today?