Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Uuid Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Primary key strategy for new services: whether to use UUIDs versus auto-increment integers for models exposed via public APIs, avoiding ID enumeration and simplifying client-side ID generation.
  • Build vs. buy vs. use-native: this package competes directly with framework-native capabilities (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.
  • Legacy modernization scope: only relevant if you maintain a Laravel 6 application that predates native UUID ergonomics and cannot be upgraded this cycle. Even then, it informs a "temporary shim, scheduled for removal" decision rather than a durable dependency choice.
  • Roadmap input, negative: signals that UUID support is a solved, commoditized concern in the framework. No roadmap capacity should be allocated to evaluating or vendoring ID-generation packages; effort belongs in migration tooling, indexing strategy, and API contract design instead.
  • Use cases it nominally enables: UUID primary keys on Eloquent models, route-model binding by UUID, and hiding sequential IDs — all achievable with a handful of lines of first-party code, which directly affects the build-vs-buy calculus.

When to Consider This Package

Consider only if:

  • You are pinned to Laravel 6 and cannot upgrade, and you need a ready-made trait rather than writing ~15 lines yourself.
  • You have audited the source (it is small and MIT-licensed) and are comfortable vendoring or forking it, since the repository is archived and will receive no fixes.
  • Your team explicitly prefers a named dependency over an inline trait for discoverability, and accepts zero upstream support.

Look elsewhere if any of the following hold — which covers almost every real scenario:

  • Laravel 9+: use the framework's HasUuids trait. First-party, tested against every release, no dependency risk.
  • Laravel 7–8: use Str::uuid() in a booted() model hook or a local trait. Trivial to write, trivial to review.
  • You need UUIDv7, ULIDs, ordered IDs, or custom column types: use ramsey/uuid, symfony/uid, or the framework's ULID support. This package does not address ordering or index-fragmentation concerns.
  • You care about maintenance signals: 20 stars, 0 dependents, last release February 2022, archived. No Laravel 10/11 compatibility evidence, no security response path, no issue triage.
  • You need anything beyond a bare trait — UUID columns in migrations, foreign-key handling, polymorphic relations, JSON API serialization conventions — this package does not cover it.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings