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 Eloquent Uuid Laravel Package

bmatovu/laravel-eloquent-uuid

A Laravel package that adds UUID support to Eloquent models, letting you use universally unique identifiers as primary keys instead of auto-incrementing integers. It handles key generation and configuration for UUID-based models.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Single-purpose Eloquent trait package: apply per model, no service provider logic of substance, no schema ownership. This maps cleanly onto Laravel's trait-composition idiom and is easy to reason about in code review.
  • The fit is undermined by redundancy: Laravel 9+ ships HasUuids (and HasUniqueStringIds in 11+), which covers the same ground with framework-maintained code. For any project on Laravel 9 or later, this package adds a dependency without adding capability.
  • The value proposition is narrow: it is a convenience wrapper around UUID key generation for teams on Laravel 8/9-era stacks, not an architectural component.

Integration feasibility

  • Composer-installable, MIT-licensed, zero dependents, and a small surface area — trivially vendorable or forkable if the decision is to keep the behavior.
  • Last release 2022-01-12 places it in the Laravel 8/9 window. Compatibility with Laravel 10/11/12 and PHP 8.2/8.3 is unverified and is the single largest unknown. Auto-discovery and Illuminate contract version constraints should be checked before any install.
  • No indication that the package manages migrations or column types, so schema work (uuid/char(36) vs binary(16)) remains the adopter's responsibility.

Technical risk

  • Archived status is the dominant risk. No security patches, no PHP deprecation fixes, no Laravel major-version support. Every future framework upgrade becomes a manual audit.
  • UUIDv4 randomness causes B-tree index fragmentation and poor insert locality on high-write tables. If the package does not offer ordered UUIDs (v7/ULID), throughput-sensitive tables will degrade.
  • Route model binding, foreign-key column typing, polymorphic relations, and pivot tables are all integration points that a tiny package is unlikely to cover comprehensively.

Key questions

  1. Which UUID versions are supported, and which generation library is used (ramsey/uuid vs Str::uuid())?
  2. Does the trait correctly set $incrementing = false, $keyType = 'string', and generate the key on the creating event?
  3. Is there test coverage for soft deletes, route binding, and relationships?
  4. Has anyone validated it against Laravel 10/11/12 and PHP 8.2+?
  5. Does it interact safely with models that also define HasUuids or custom getKey() behavior?

Signal read: 3 stars, 0 dependents, archived, composite score 0.0075 against an opportunity score of 11.87. The gap says the problem space (UUID primary keys in Eloquent) is valuable; this implementation is not the vehicle. Treat the repository as reference code, not a dependency.

Integration Approach

Stack fit

  • Appropriate only for Laravel 8.x/9.x projects on PHP 7.4–8.1 that already have UUID primary keys in their schema and need a thin trait.
  • Poor fit for greenfield work: the framework already provides the capability, and adopting an archived package inverts the build-vs-buy calculus.

Migration path

  • Option A (recommended): Use native HasUuids. Zero dependency, framework-supported, upgrade-safe.
  • Option B: Vendor the trait into app/Models/Concerns/ under your own namespace. MIT permits this; you inherit maintenance but gain control and can add UUIDv7 support.
  • Option C: Install as-is only if already committed to the Laravel 8/9 window and pinned by Composer. Do not adopt for new services.

If the codebase already depends on the package, the migration is mechanical: replace the trait import, delete $incrementing/$keyType overrides if the native trait handles them, run the test suite, and drop the dependency.

Compatibility

  • Pin the Composer constraint and run an explicit compatibility matrix (Laravel 9/10/11 × PHP 8.1/8.2/8.3) before merging. There is no upstream maintainer to fix what the matrix surfaces.
  • Confirm column types align between application and database: char(36) versus native uuid versus binary(16). Mismatches surface as join failures, not as install errors.

Sequencing

  1. Confirm the framework version and whether native UUID traits are available.
  2. Proof-of-concept on one non-critical model; verify insert, route binding, and a has-many relation.
  3. Decide the column type and lock it in a migration before any data exists.
  4. Define a backfill strategy if existing integer-keyed tables are being converted.
  5. Roll out model by model, with the test suite gating each step.
  6. If adopting, schedule the removal/inlining work at the same time — do not leave an archived package in the dependency graph indefinitely.

Operational Impact

Maintenance

  • Zero upstream maintenance. The team owns every bug, deprecation, and framework-compatibility fix from day one. Budget a small but permanent tax against a capability the framework gives away free.
  • Dependency scanners and SBOM reviews will flag an archived package; expect recurring exceptions to justify.

Support

  • No vendor, no SLA, no maintainer response path. Support is limited to reading the source and community precedent — and with 3 stars and 0 dependents, there is effectively no community to draw on.
  • Incident response depends entirely on internal familiarity with the trait's few dozen lines.

Scaling

  • Storage: char(36) costs ~2.25× a binary(16) representation per key, multiplied across primary keys and every foreign-key column that references them.
  • Index behavior: random UUIDv4 inserts scatter across B-tree pages, degrading write throughput and cache efficiency on large, write-heavy tables. Ordered identifiers (UUIDv7/ULID) mitigate this; verify whether the package supports them, and assume it does not.
  • Read paths are largely unaffected; the cost concentrates in insert volume and index maintenance.

Failure modes

  • Trait omitted on a new model → null or missing primary key at insert time, caught late.
  • Foreign-key column typed differently from the primary key → silent join mismatches and orphaned relations.
  • Route model binding returning 404 for records that exist, due to key-type or getKey() inconsistencies.
  • Framework upgrade breaking the trait's boot method without a failing test to catch it.
  • UUIDv4 collision is negligible in probability but non-zero and unrecoverable without a unique constraint.

Ramp-up

  • Learning cost is genuinely low — one trait, a handful of properties — so individual developer onboarding is a non-issue.
  • Organizational ramp-up is the real cost: every engineer who touches the dependency must know it is unmaintained and unsupported by the framework. That knowledge does not survive team turnover without documentation.
  • Recommendation: do not add this package to a new or actively upgraded codebase. Use native HasUuids, or vendor the ~50 lines if Laravel 8/9 compatibility forces the issue, and close the dependency out.
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.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource