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

naabster/laravel-eloquent-hashids

Integrate Hashids with Laravel Eloquent models: automatically encode numeric IDs into short, obfuscated strings and decode them back. Supports route model binding, custom salts, and seamless model lookups for cleaner, safer URLs.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Exposing public identifiers without leaking database internals. Hashids-style encoding lets the product surface short, opaque IDs (order links, invoice references, share URLs, referral codes) instead of auto-increment primary keys — reducing enumeration/scraping risk and removing a signal about business volume ("order #1042" tells competitors your scale).
  • Build vs. buy vs. hand-roll. This package is a thin Laravel integration over vinkla/hashids, so the realistic decision is not "should we use Hashids" but "should we wire it up ourselves (service provider, config, facade, validation rule, model trait) or adopt a maintained wrapper." For a small integration surface, this is a low-cost buy.
  • Roadmap sequencing for public-facing surfaces. If the roadmap includes customer-facing URLs, public API resources, or shareable links, deciding the ID strategy now avoids a later migration of externally referenced identifiers — one of the more expensive retrofits a team can undertake.
  • Use cases: short invite/referral codes, non-guessable download or receipt links, obfuscated IDs in URLs and API responses, and masking sequential IDs in exports or support tooling.
  • Release 1.0.4 signal (dependency hygiene): the only change is bumping the required vinkla/hashids to the current Laravel 5-compatible version. Product read: this is a maintenance release, not a capability release. It tells you the package is still tracking its upstream dependency and Laravel 5 compatibility — a positive but weak maintenance signal, and evidence the package's lifecycle is still coupled to the Laravel 5 era.

When to Consider This Package

  • You are on Laravel 5.x and want Hashids with framework-native config, DI, and facades rather than a raw library call. The 1.0.4 dependency bump exists specifically to keep this pairing working — that's the package's core value proposition.
  • You need short, reversible, opaque IDs and are comfortable that encoding is obfuscation, not encryption (anyone with the salt and alphabet can decode). Do not treat this as a security boundary.
  • The integration surface is small enough that a wrapper is cheap insurance — but also small enough that inlining ~50 lines of service-provider code is a legitimate alternative. If your team already has an ID/ULID/UUID strategy, adding Hashids creates a second identifier scheme to reason about.
  • Look elsewhere when:
    • You're on Laravel 6+ or newer — a Laravel 5-oriented dependency bump is a yellow flag that this package may lag the framework; check upstream vinkla/hashids directly or use a maintained fork.
    • You need non-reversible tokens (password resets, signed URLs, API auth) — use Laravel's signed URLs / encryption / a dedicated token library instead.
    • You need sortable, collision-resistant, or distributed-generated IDs — UUIDv7/ULID is the better primitive.
    • You require strict non-enumerability at scale: Hashids output is deterministic per salt+alphabet, so rotating salts invalidates every previously issued link. Plan for that operationally before adopting.
  • Salt management is a prerequisite, not a detail. If you can't guarantee a secret, environment-scoped salt and a rotation plan, the product benefit is marginal and the migration risk is real.

How to Pitch It (Stakeholders)

For executives: This is a small, low-risk dependency that changes how we present record IDs to customers — short, non-guessable references instead of sequential numbers. The business value is reduced exposure of operational data and a cleaner public-facing identifier scheme, at near-zero build cost. The latest release (1.0.4) is a maintenance update that keeps it compatible with our Laravel 5 dependency; no new features, no breaking changes, no action required from a product standpoint.

For engineering: 1.0.4 is a dependency-only change — it bumps vinkla/hashids to the current Laravel 5-compatible version. Treat it as a routine patch: safe to take, but it confirms the package's support envelope is Laravel 5-era. Two things to decide explicitly before we lean on it: (1) where the salt lives and how we'd rotate it, since rotation invalidates all issued links; and (2) whether this is our canonical public identifier or a compatibility shim in front of a future UUID/ULID migration. If we're planning a framework upgrade, verify upstream vinkla/hashids compatibility first rather than assuming this wrapper will follow.

Recommendation: Adopt for Laravel 5 surfaces where short opaque IDs are needed now; do not treat it as a long-term identifier strategy without an explicit exit path. Re-assess if the package shows no releases alongside a framework upgrade, or if a feature release lands that changes encoding behavior (that would be a breaking change for every previously issued link).

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