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 Model Laravel Package

xzxzyzyz/laravel-uuid-model

Add UUID primary key support to Laravel Eloquent models. This package helps replace auto-incrementing IDs with universally unique identifiers, useful for distributed systems, public-facing IDs, and safer record references, while keeping model integration simple.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Provides an Eloquent-level concern (trait/cast/base model) for UUID keys — a thin, idiomatic layer if implemented as a trait. Fits Laravel's model lifecycle, but the same ground is already covered natively by HasUuids / HasUniqueStringIds (Laravel 9+), so the package only earns its place if it adds something the framework does not: ordered UUIDs (v6/v7), binary(16) storage, per-model key configuration, or migration/stub helpers.
  • Fit degrades if the package reaches into migrations, route binding, or relationship key types beyond what a trait can safely own — those are the areas where opaque third-party behavior becomes expensive to debug.

Integration feasibility

  • MIT license and a small public surface make it cheap to read, vendor, or fork — the realistic worst case is "copy the trait in-house."
  • Feasibility hinges on unverified facts: supported Laravel/PHP version matrix, test suite and CI, database driver coverage (MySQL/Postgres/SQLite), and whether it handles getKeyType, getIncrementing, whereKey, JSON serialization, and route model binding correctly.

Technical risk

  • Adoption risk (high): 0 stars, 0 dependents, single maintainer. No field validation, no issue history to mine, no downstream projects proving it in production.
  • Supply-chain risk (moderate): low-traffic, generic-sounding vendor/package names are the classic typosquat/hijack profile; pinning and lockfile discipline are mandatory.
  • Duplication risk (high): framework overlap means the package may be obsolete within one Laravel minor release.
  • Metadata anomaly: release date of 2026-03-18 should be verified against Packagist before any dependency decision.

Key questions

  • What does this give us that HasUuids does not? Specifically: UUID version (v4 vs v7), storage type (char(36) vs binary(16)), and index strategy?
  • Which Laravel/PHP versions and DB drivers are tested in CI, and what is the coverage of relationships, pivots, and route binding?
  • Who maintains it, what is the commit/release cadence, and is there a security disclosure path?
  • Are there transitive dependencies, and does the package register any global service provider behavior or model boot hooks?
  • Does it support coexisting integer-keyed and UUID-keyed models in the same application?

Integration Approach

Stack fit

  • Only worth adopting on Laravel 9+ if it delivers ordered UUIDs or binary storage; otherwise use the native trait and skip the dependency entirely.
  • Assumes PHP 8.1+, Composer 2, and standard Eloquent. No framework-level conflicts expected given the narrow scope, but any package assuming integer keys (Sanctum tokens, permission tables, audit logs, admin panels) must be validated.

Migration path

  • Greenfield tables and new aggregates only. Retrofitting UUIDs onto existing auto-increment primary keys requires rewriting foreign keys, rebuilding clustered indexes, and a coordinated backfill — cost is typically 10–50x the value for a package with this risk profile.
  • For existing systems, use a strangler approach: introduce UUIDs as a secondary public identifier (uuid column with unique index) on new and high-exposure tables, keeping the integer PK internal. This captures the external-facing benefit without touching referential integrity.

Compatibility

  • Build a matrix before committing: Laravel LTS + current, PHP 8.1–8.3, MySQL 8 / Postgres 15 / SQLite. Explicitly test find(), findOrFail(), route binding, toArray()/JSON, whereKey, updateOrCreate, and belongsTo/belongsToMany hydration.
  • Verify behavior under php artisan migrate:fresh, rollback, and model factories — UUID packages frequently break factory create() flows or model replication.

Sequencing

  1. Timeboxed spike (≤1 day) in a throwaway branch, benchmarked head-to-head against HasUuids.
  2. Internal decision record: native vs third-party, UUIDv4 vs v7, char(36) vs binary(16).
  3. Pilot on one non-critical, greenfield model with contract tests around key generation and serialization.
  4. Pin the exact version, vendor if the surface is small, and add it to the dependency-review list.
  5. Expand only after the pilot survives one full framework upgrade cycle.

Operational Impact

Maintenance

  • Tiny code surface is a double-edged sword: cheap to fork, but no upstream safety net. Assume a realistic 30–50% probability of needing to own the trait internally within 18 months. Budget ~1–2 engineer-days per year for review plus fork maintenance if abandoned.
  • Enforce Composer version pinning, lockfile review, and automated dependency alerts; block unreviewed transitive additions.

Support

  • No community, no vendor SLA, no documented troubleshooting. All support is internal. Require the adopting team to write a short internal runbook covering key format, storage type, and debugging steps before merge.

Scaling

  • UUIDv4 primary keys on InnoDB cause random insert patterns, page splits, and index bloat — measurable write-throughput loss above roughly 1–2k inserts/sec and 2–4x index size versus BIGINT. Ordered UUIDs (v7) or binary(16) storage largely neutralize this; char(36) storage does not.
  • Read-heavy and low-write tables are unaffected. Model the storage delta explicitly for any table expected to exceed ~10M rows.

Failure modes

  • Silent fallback to auto-increment when the trait is not applied, producing mixed key types across tables.
  • Foreign key type mismatch (char(36) vs binary(16)) surfacing as broken relations rather than a clean schema error.
  • Route model binding returning 404 for non-UUID inputs — needs a deliberate 404-vs-400 decision.
  • Package abandonment or removal from Packagist breaking composer install in CI; mitigated by vendoring or a private mirror.
  • Framework upgrade conflicts if the package overrides methods that Laravel's native UUID support now owns.

Ramp-up

  • Near-zero for a competent Laravel developer (1–2 hours to read the trait and apply it).
  • The real ramp-up is organizational: agreeing on one UUID convention, documenting it, and teaching support/on-call that UUIDs are not human-scannable — grep, log correlation, and support-ticket workflows all need adjustment.
  • Net recommendation: treat as a reference implementation, not a dependency. Copy the pattern into an internal trait unless the spike proves a concrete capability gap versus HasUuids.
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.
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
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums