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

Globalid Laravel Laravel Package

tonysm/globalid-laravel

GlobalID for Laravel brings Rails-style global identifiers to Eloquent models. Generate and parse stable gid:// strings for any model record, create signed GlobalIDs for secure expiration, and use them in jobs, URLs, and APIs without exposing raw IDs.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • tonysm/globalid-laravel implements GlobalID-style opaque model references (signed/encrypted "locator" strings that resolve back to an Eloquent model instance), which is a well-understood pattern from Rails. It fits cleanly into Laravel's service-container/eloquent conventions and is most valuable where model identifiers cross a trust boundary: queued jobs, webhook payloads, public APIs, and URLs that should not expose sequential primary keys.
  • This is an infrastructure/plumbing dependency, not a feature package. It should be treated as part of the platform layer (alongside queue, encryption, and serialization), which means it carries a higher blast radius than its size suggests: every consumer that persists or transmits a GID string inherits its compatibility contract.

Integration feasibility

  • Low-to-moderate effort for a greenfield adoption: install, publish config, register locators, and use the provided helpers/traits. The real cost is not installation but the audit of every place a GID string is produced or consumed — API responses, signed URLs, queued payloads, third-party webhooks, and any stored column holding a GID.
  • 1.5.0 is directly relevant to feasibility because it changes two things an adopter must design around:
    1. Encryption key rotation — previously, rotating APP_KEY (or the package's cipher key) would have invalidated every outstanding GID. Rotation support removes a hard operational constraint and makes the package viable for teams with key-rotation compliance requirements. This is a genuine enabler, not a convenience.
    2. Only registered locators returned, no general fallback — the resolver no longer falls back to arbitrary class resolution. This is a security tightening (it closes a class-instantiation surface if a GID's payload could be influenced) but it is a behavioral change: any environment relying on the fallback will start failing to resolve previously-working identifiers.

Technical risk

  • Behavioral break (highest). The removal of the general fallback is the item that warrants the update. It is not marked as a breaking change in the notes, yet it changes resolution semantics. Risk is concentrated in applications that never explicitly registered locators and relied on implicit resolution. Severity is high where resolution happens inside queued jobs: a failed resolution mid-queue can mean dropped or repeatedly-retrying jobs rather than a clean 4xx.
  • Key rotation correctness. Rotation introduces a "current key + previous key(s)" model. Risk areas: how many historical keys are retained, whether re-encryption of stored GIDs is supported or whether old keys must be kept indefinitely, and whether rotation is atomic across horizontally-scaled workers. If workers roll out at different times, a window exists where some nodes cannot decrypt GIDs produced by others.
  • Silent failure surface. Resolution failures in this class of package tend to surface as ModelNotFoundException or a null return, which is easy to swallow in a try/catch and hard to observe. Absent explicit metrics, a fallback removal can degrade quietly.
  • Upgrade cost is low in code, moderate in verification. The diff is small; the test surface (round-trip encode/decode across deploy boundaries, queue replay, cached responses) is what takes the time.

Key questions

  • Which of our services currently resolve GIDs without explicit locator registration? That set defines the true breaking-change surface.
  • Does the rotation feature support decrypting with N prior keys, and is there a documented retention policy? Can we re-encrypt stored GIDs, or are old keys permanent operational baggage?
  • Is a GID's encoded payload authenticated (signed) as well as encrypted, and is the model class included in the payload? This determines whether the removed fallback was a live vulnerability for us or only a latent one.
  • Are GIDs persisted at rest anywhere (DB columns, search indices, analytics warehouses)? If so, rotation has a data-migration dimension, not just a config dimension.
  • What is the package's release cadence and bus-factor? Single-maintainer packages in the serialization path deserve a contingency note.

Integration Approach

Stack fit

  • Assumes Laravel 9/10/11-era conventions (service provider auto-discovery, config publishing, Eloquent model resolution). Verify the supported PHP/Laravel matrix against our current LTS target before committing; a package in the serialization path should not be the reason we cannot take a framework upgrade.
  • Complements rather than duplicates Laravel's native HasUuids/HasUlids and signed URLs. Decision to record: UUID/ULID solves enumeration but not class disclosure or tamper-resistance; GlobalID solves both. We should pick one convention per surface and document it, otherwise we will end up with two identifier idioms in the same API.

Migration path

  • Phase 0 — Inventory. Enumerate GID producers and consumers; classify each as (a) internal only, (b) persisted, (c) externally exposed. Only (b) and (c) constrain the migration.
  • Phase 1 — Register locators explicitly, in the current version, before upgrading. This is the single most important step: it converts the 1.5.0 fallback removal from a surprise into a no-op. Ship this as an independent, low-risk change.
  • Phase 2 — Upgrade to 1.5.0 behind full test coverage of encode/decode round-trips, including a fixture set of GIDs generated on the previous version to prove backward decryption still works.
  • Phase 3 — Introduce rotation only after 1.5.0 is stable in production: define key custody, retention count, and a runbook. Do not combine the rotation rollout with the version upgrade; they are separate failure domains.

Compatibility

  • Forward: GIDs minted pre-1.5.0 should continue to decode if the cipher key is unchanged — this must be asserted with fixtures, not assumed.
  • Backward: GIDs minted post-1.5.0 will be unreadable by 1.4.0 nodes during a rolling deploy. With N>1 app servers, either drain-then-deploy or ensure the resolver path tolerates decode failure gracefully during the transition window.
  • Cross-service: any non-PHP consumer that parses GID strings (JS front-end, mobile client, partner integration) is unaffected by the fallback change but is affected by key rotation if it validates rather than just passes through.

Sequencing

  1. Inventory + explicit locator registration (current version).
  2. Add GID round-trip fixtures to CI — this is the safety net for every later step.
  3. Upgrade to 1.5.0; deploy with drain or accept a short mixed-version window.
  4. Observe resolution-failure rate for one full release cycle.
  5. Only then design key rotation, with custody and retention documented.
  6. Re-encrypt or grandfather persisted GIDs; never rotate without a written answer to "what happens to data written under key N-1."

Operational Impact

Maintenance

  • Ongoing burden is low in code and moderate in discipline: the package's correctness depends on configuration (keys, registered locators) that is invisible at the call site. Treat locator registration as code that requires review, and key configuration as a secret-management concern owned by platform, not application teams.
  • Pin the version and read release notes on every bump. This release demonstrates the risk profile: two changes, one of which is behaviorally breaking but is not labeled as such. Assume future releases may be similarly under-annotated and budget review time accordingly.

Support

  • Two support questions will dominate: "why won't this GID resolve" (almost always: locator not registered, or key mismatch after rotation) and "can we rotate keys" (answer now yes, with caveats). Both should be pre-written as runbook entries before rollout, not after the first incident.
  • Escalation path for a single-maintainer dependency: we need the ability to vendor-patch. Confirm the license permits it and that the code is small enough for one of our engineers to own in an emergency.

Scaling

  • Encoding/decoding is CPU-bound symmetric crypto per operation — negligible per call, but relevant if GIDs are resolved in tight loops (large collection serialization, bulk job dispatch). Measure before optimizing; the likely mitigation is resolving at the boundary rather than per-item.
  • Key rotation scales poorly if it requires re-encrypting a large stored corpus. If we persist GIDs at volume, prefer a design where rotation retains old keys for decryption and new writes use the current key, avoiding a bulk migration entirely.

Failure modes

  • Locator not registered → resolution returns null/throws. Post-1.5.0 this is now a reachable state where it previously fell back. Highest-probability new failure.
  • Key mismatch / missing historical key → undecryptable GIDs; manifests as mass job failures across all workers simultaneously, which is a strong signal and therefore the easier failure to diagnose.
  • Mixed-version fleet → intermittent, node-dependent failures. Worst diagnostic profile; avoid the window entirely.
  • Tampered or user-supplied GID → should fail closed. Post-1.5.0 it does so more strictly; verify our error handling returns 4xx rather than 5xx to avoid noisy alerting from routine bad input.
  • Persistence drift → GIDs stored in DB or a search index outliving their key. Silent until a read path activates.

Ramp-up

  • An engineer can be productive with this package in under a day: the API surface is small and the GlobalID concept is well documented upstream. The ramp-up cost sits in the operational context — key custody, locator registry, and which surfaces are allowed to emit GIDs — which is organizational knowledge, not library knowledge.
  • Recommend a short ADR recording: why GlobalID over UUID/ULID, the locator registry as the source of truth, the key retention policy, and the explicit note that unregistered classes no longer resolve. That document is what prevents this release's behavioral change from becoming an incident during a future upgrade.
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.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
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