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

Eloquent Uuid Laravel Package

alsofronie/eloquent-uuid

alsofronie/eloquent-uuid adds UUID primary key support to Laravel Eloquent models, with traits that automatically generate UUIDs on create and let models replace auto-incrementing integer keys with minimal configuration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Identifier strategy for new features. Whether a feature (public-facing records, cross-system sync, multi-tenant data, audit/log tables) should use auto-increment integers or UUIDs. This package represents the "UUID primary key" option on legacy Laravel, so evaluating it forces the real decision: opaque, non-enumerable IDs vs. compact, sortable integers.
  • Build vs. buy for a UUID trait. The package is a thin Eloquent trait (generate UUID on create, string key type, non-incrementing). That is roughly 20–40 lines of in-house code, and Laravel 9+ ships HasUuids natively. The buy case is weak; the decision record should note that this is a commodity capability, not a differentiator.
  • Roadmap / upgrade sequencing. Because the package targets Laravel 5.1–5.2 (both long EOL), adopting it is implicitly a decision to stay on an unsupported framework. Use it as a forcing function to schedule the Laravel upgrade and fold the identifier change into that workstream rather than layering a dead dependency on top of a dead framework.
  • Legacy maintenance triage. For an existing 5.1/5.2 app that already depends on this trait, the PM decision is "freeze vs. replace vs. migrate": keep it pinned, replace with an in-house trait, or migrate to framework-native UUIDs during the next upgrade.
  • Use-case gating. Where UUIDs genuinely pay off — exposing IDs in URLs/APIs, merging records across environments, offline-first or client-generated IDs, distributed writes without a central sequence — vs. where they cost you (16–36 bytes per key, index bloat, loss of natural ordering, harder debugging).
  • Data model and integration contracts. Any public API or partner integration that will key on these identifiers needs the format decided (v4 random vs. v7/ULID time-ordered, string vs. binary storage) before schema freeze, since changing identifier format later is a breaking data migration.

When to Consider This Package

Consider it only when all of the following hold:

  • You maintain a Laravel 5.1 or 5.2 application that cannot be upgraded in the current cycle.
  • You need UUID primary keys on a small number of models and want a drop-in trait rather than writing one.
  • You accept no maintainer, no releases since July 2017, no security response, and no compatibility guarantees — it is effectively vendored code you now own.
  • The blast radius is contained: internal models, no auth/session or payment-critical keys, and you have a test suite that would catch key-generation regressions.

Look elsewhere (or build in-house) when:

  • You are on Laravel 9+ — use the built-in HasUuids / HasUniqueStringIds and uuid column type; adding a 2017 package here is pure liability.
  • You need time-ordered identifiers (UUIDv7, ULID) for index locality and sortability; this package predates that practice.
  • You need binary/compact storage (16-byte BINARY(16) with ramsey/uuid), UUID validation, or UUID-aware route model binding — use ramsey/uuid or framework-native tooling directly.
  • You need client-side or offline ID generation with collision guarantees across devices — that is an architecture decision (ULID/UUIDv7 + idempotency keys), not a trait.
  • Your threat model includes ID enumeration on sensitive resources — the right answer is authorization and rate limiting, plus opaque IDs; a trait alone is not a security control.

How to Pitch It (Stakeholders)

Executives: This is a 94-star, MIT-licensed micro-library that adds UUID primary keys to Eloquent models on Laravel 5.1/5.2. It has had no release since 2017 and no active maintainer. The capability it provides is now native to modern Laravel, so it carries near-zero strategic value and non-trivial technical debt. Recommendation: do not introduce it into new work; treat it as a stopgap for legacy systems only, and fund the Laravel upgrade that removes the need for it.

Engineering: The trait is a commodity — a few dozen lines we could own outright, and a first-class feature in Laravel 9+. Its constraints will pin us to EOL framework versions, it will receive no patches, and it offers no support for UUIDv7/ULID, binary storage, or validation. If we must use it short-term, wrap it behind our own trait so we can swap the implementation during the upgrade without touching every model. The real decision to sign off on is the identifier scheme (v4 vs. time-ordered, string vs. binary, which tables), because that is expensive to change later; the library choice is incidental and reversible.

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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels