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

Hash Ids Bundle Laravel Package

jasonbradley/hash-ids-bundle

Symfony bundle wrapping the hashids library to encode numeric IDs into short, reversible, non-sequential hashes—useful for hiding database IDs in URLs and public APIs. Adds service and Twig integration for encoding and decoding throughout a Symfony app.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

Framing note first: despite the request framing, this is a Symfony2 bundle, not a Laravel package — no service provider, facade, or publishable config. It is a thin DI wrapper around the hashids/hashids library. So the decision it actually informs is "do we adopt the hashids pattern, and if so via what dependency?" — not an evaluation of a Laravel integration.

  • Public identifier strategy (customer-facing). Whether to expose sequential integer IDs in URLs, emails, invoices, and share links. Hashids encodes an integer into a short opaque-looking string (/orders/x7Kp2 vs /orders/1043) and decodes it back — no schema change, no extra column, no lookup table.
  • Anti-enumeration as a product-trust decision. Sequential IDs make "how many customers do you have?" and "let me try ID 1044" trivially cheap. Relevant for order references, support ticket IDs, referral links, and public API resource paths.
  • Build vs buy vs skip. The capability is worth ~1 day of work; the wrapper is not worth a dependency. This package supports the recommendation "adopt the maintained library directly (Sqids or hashids/hashids), not this bundle."
  • Roadmap sizing for an ID migration. Changing public identifiers is cross-cutting — URLs, redirects, sent-email history, analytics dimensions, partner integrations, support scripts, saved bookmarks. This assessment frames it as a scoped migration with a dual-read/redirect period, not a one-line swap.
  • Security boundary setting (a decision this package must not support). Hashids is reversible encoding, not encryption or authorization. A PM should explicitly record that adopting it does not reduce the need for per-object authorization checks on every resource — the salt is the only secret and it leaks the moment it's committed.
  • Use cases it fits: short share/referral codes, human-readable support references, obfuscated public IDs where a DB lookup is undesirable.

When to Consider This Package

Consider the underlying pattern when:

  • You expose auto-increment primary keys in public URLs or APIs.
  • You need reversible short codes (decode back to int) with no storage cost.
  • You want a drop-in that requires no migration and no new column.

Look elsewhere than this specific bundle — effectively always:

  • Symfony2 reached end-of-life in November 2018. The bundle's last release was 2015-08-05; it will not run on modern Symfony, let alone Laravel.
  • 0 stars, 0 dependents — no community review, no issue triage, no security eyes, no one to patch it. Zero dependents also means zero real-world battle testing.
  • Licensing is fine (MIT), maintenance is not. You could vendor the wrapper, but that just relocates the maintenance burden without removing it.
  • No evidence of CI/tests in the package signals.

Look elsewhere than hashids entirely when:

  • You need unguessable capability URLs or security tokens — hashids is fully reversible given the salt; use random tokens with server-side lookup.
  • You need sortable or index-friendly identifiers — use UUIDv7 or ULIDs.
  • You're at volume or need collision-free guarantees across shards; hashids has alphabet/length constraints and a global salt per deployment.
  • You want a maintained successor: Sqids is the current, actively maintained evolution of the hashids idea and has Laravel-ecosystem support.

How to Pitch It (Stakeholders)

For executives (30 seconds): Sequential IDs leak business volume and invite scraping; making customer-facing IDs opaque is a small, worthwhile trust improvement. This particular package is not the vehicle — it's a 2015 Symfony bundle with zero stars and zero users, abandoned through a framework EOL. Recommendation: no-go on the dependency, go on the pattern, delivered with a maintained library and roughly X engineer-days including the redirect/back-compat work. No license cost; MIT.

For engineering (the actual ask): It's a one-class DI wrapper around hashids/hashids. There is no reason to inherit a dead Symfony2 dependency to get it. Use the maintained library directly (or Sqids), wrap it in a small internal service so the encoding choice is swappable, and keep the salt in secrets management from day one. Design the decode path to fail gracefully on malformed input rather than 500.

Risk framing: Supply chain exposure is low but non-zero — tiny code surface, so little to exploit, but nobody to ship a fix. The real risk is theater: shipping hashids and believing enumeration/authorization is handled. Pair the change with an authorization review, and treat the identifier change as a migration with a measured redirect window rather than a silent cutover.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
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
cgv/localized-resource