kadevland/simple-laravel-eloquent-uuid
A lightweight Laravel package that adds UUID primary keys to Eloquent models with minimal setup. Use a simple trait to generate UUIDs automatically, keep models clean, and avoid manual ID handling in your database.
HasUuids, available in modern Laravel) or a ~15-line in-house trait. This package does not meaningfully shorten the work, so it should not appear on a build-vs-buy comparison as a "buy" option.Adoption criteria — all of these would have to be true simultaneously:
HasUuids concern, and upgrading is not on the near-term roadmap.$keyType = 'string', $incrementing = false, and a creating hook assigning (string) Str::uuid()).HasUuids/HasUniqueStringIds concerns. Absent a passing test run, assume it is unverified.Look elsewhere (or build in-house) when:
creating event is a supply-chain and upgrade-blocking liability disproportionate to the ~15 lines it saves.For executives: This is a small, MIT-licensed community trait that assigns UUIDs to Eloquent model IDs so records don't expose sequential numbers. The product rationale for UUIDs is real but narrow — public-facing IDs, multi-source data merging, client-generated IDs. The important finding is that the underlying capability is now built into Laravel itself, so the strategic recommendation is not to add this dependency. Adopting an unmaintained 2020 package to save a few lines of code introduces upgrade and security-review friction with essentially no offsetting benefit. Recommendation: no adoption; use the framework feature, or write and own a short trait. Net engineering cost is negligible either way, and the decision that actually needs executive input is the schema/API one — whether we commit to non-sequential public identifiers, with its known indexing trade-offs.
For engineering: Treat this as obsolete-by-default. The last release predates Laravel 9's HasUuids, so the package's entire value proposition is now a first-party feature; on older versions the trait is trivial to write and test in-house. Any adoption should be a vendored/forked copy with a compatibility test against our Laravel and PHP matrix, not a Composer dependency — a single-maintainer package that hooks the creating event and may collide with native HasUuids/HasUniqueStringIds or our own $keyType conventions is an avoidable upgrade hazard. If we do go UUID-primary in places, pair the decision with explicit guidance on ordered UUIDs vs. ULIDs for insert-heavy tables, a plan for relation/foreign-key columns, and a compact-storage option if index bloat shows up in production metrics.
How can I help you explore Laravel packages today?