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

Hashids Bundle Laravel Package

netbull/hashids-bundle

A Symfony bundle that wraps Hashids to turn integer IDs into short, unique, non-sequential hashes, so you can hide database IDs in URLs. Provides container integration and configuration for encoding and decoding IDs through a simple service.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is not a Laravel package — it is a Symfony bundle (netbull/HashidsBundle). It ships a Symfony Bundle class, DI extension, and configuration tree (netbull_hashids: …), plus a Doctrine bridge for auto-hashing entity identifiers. None of that registers in Laravel's service container, package auto-discovery, or config/ publishing model. In a Laravel codebase the bundle itself is dead weight; the only reusable asset is the underlying hashids/hashids library it wraps, which we can consume directly in a service provider. Net: the package under evaluation is the wrong shape for our stack, and the useful surface area is ~1 class and a config array.

Integration feasibility. High in the abstract, low for this artifact. Hashids is a small, pure-PHP, stateless library with no framework coupling; wiring it into Laravel (singleton binding + config + a model cast/trait) is a few dozen lines and does not require the bundle. The bundle adds Symfony-specific value (Doctrine type, container wiring, Symfony config validation) that is worthless to us and would need to be re-implemented rather than reused. There is essentially no integration path that justifies depending on the bundle rather than the library.

Technical risk.

  • License — AGPL-3.0 is the dominant risk. AGPL's network-use clause treats serving the software over a network as distribution, obligating source disclosure for the combined work. For any SaaS or embedded product this requires explicit legal sign-off and likely a clean-room reimplementation or alternative; it is a common hard blocker under standard corporate OSS policy.
  • Adoption signal is effectively zero — 0 stars, 0 dependents. There is no evidence of production use, no third-party test coverage, and no community to catch defects. Bus factor is 1.
  • Upstream Hashids is legacy. The Hashids author has publicly steered users to its successor (sqids/sqids); Hashids is feature-frozen. Betting on it is a small but real longevity risk.
  • Security model is often misunderstood. Hashids is reversible obfuscation, not encryption. Anyone with the salt and alphabet can enumerate. It must never be the sole control protecting access to a resource; authorization still has to be server-side.
  • Freshness is a bright spot — a 2025-11 release means the maintainer is still tagging, so it is not abandoned. That does not offset the above.

Key questions.

  1. Has Legal approved AGPL-3.0 for network-served use, or do we treat this as a blocker?
  2. Do we actually need the Symfony/Doctrine integration, or only the hashing primitive?
  3. Is Hashids still the right choice versus sqids (successor) or native UUIDv7 / ULID?
  4. Is the salt already defined and stable in our environments, and where will it live (secrets manager, not .env in VCS)?
  5. What breaks if the salt or alphabet rotates — which external identifiers are already exposed?

Integration Approach

Stack fit. Poor as-is. Laravel expects a service provider, a publishable config, and preferably a facade or a Cast. The bundle provides none of these; its public API is a Symfony DI alias. Adopting it would mean either ignoring most of it or dragging Symfony components into a Laravel app — the latter is not acceptable.

Migration path. Do not install the bundle. Install hashids/hashids (or sqids/sqids) and implement a thin Laravel adapter:

  • A HashidsServiceProvider registering a singleton built from config/hashids.php (salt, min length, alphabet) sourced from the secrets manager.
  • A model cast / trait (HasHashedId) exposing hashid in serialized output and resolving hash → model on route binding, so controllers never see raw integers.
  • A Route::bind or getRouteKey() override on affected models.

This is a ~1–2 day build, fully owned, license-clean, and testable — and it removes the AGPL question entirely. If we were already a Symfony shop, the bundle would be a reasonable convenience; we are not.

Compatibility. The underlying library is stateless PHP with broad 7.4/8.x support and no Laravel-version-specific coupling, so Laravel 10/11/12 compatibility is not a concern. The relevant compatibility surface is PHP version, the salt/alphabet config format, and how identifiers are exposed in API contracts.

Sequencing.

  1. Legal ruling on AGPL (or decision to reimplement) — gate.
  2. Decide primitive: Hashids vs Sqids vs ULID/UUIDv7 (ULID is worth serious consideration if we are starting fresh — sortable, no salt management, no reversibility debate).
  3. Build the service provider + cast + route binding; unit tests for round-trip, collision/min-length behavior, and invalid-hash rejection.
  4. Roll out to internal-only identifiers first; verify round-trip fidelity across environments with identical salts.
  5. Only then expose in public URLs/API responses; document the salt rotation policy in the runbook.

Operational Impact

Maintenance. Ownership sits with us either way. If we take the bundle, we inherit a single-maintainer, zero-dependent dependency over an upstream library that is in maintenance mode — expected ongoing cost is low in code terms and high in attention terms (we must watch a dependency nobody else watches). Reimplementing against the library directly reduces the dependency tree by one and eliminates the framework-mismatch maintenance burden. Either way, plan a periodic review to reassess against Sqids.

Support. No community, no Stack Overflow corpus, no vendor. Defect triage is entirely on our team; realistic SLA is "best effort, internal." This is acceptable for a ~100-line wrapper and unacceptable for anything load-bearing on the bundle's Symfony glue.

Scaling. Non-issue. Hashids/Sqids are O(n) arithmetic on the integer, CPU-negligible, stateless, horizontally scalable, and cache-free. The only scaling-adjacent concern is URL length if min_length is set aggressively, which is bounded and predictable.

Failure modes.

  • Salt rotation = breaking change. Every previously issued hash stops resolving. Requires either a versioned prefix or a durable salt in the secrets manager; treat salt as append-only.
  • Salt leakage = enumerability. Anyone with salt+alphabet decodes all IDs. Mitigation: never rely on hashing for authorization; keep access checks server-side and consider UUIDs where unpredictability is the requirement.
  • Collision / short-circuit. Insufficient min_length or a truncated alphabet raises collision probability; enforce a floor and test it.
  • Misconfiguration drift between environments produces hashes that resolve in one environment and 404 in another — a classic and confusing incident. Enforce config parity in CI.
  • Silent decryption of malformed input returning zero/garbage rather than throwing — validate and 404 explicitly.

Ramp-up. Engineering ramp-up is genuinely low: the primitive is simple, well understood, and the adapter is small — a mid-level developer is productive in half a day. The organizational ramp-up is the real cost: AGPL legal review, security review of the obfuscation-vs-authorization boundary, and a secrets-management decision. Budget roughly one week end-to-end, dominated by legal and process rather than code.

Overall TPM read. Do not adopt the bundle. The score, zero stars, and zero dependents are consistent with the substance: the artifact is a Symfony-shaped convenience wrapper around a legacy library, under a license that likely blocks our use case. The idea (non-sequential public identifiers) is sound and worth ~1–2 developer-days; evaluate it as a build-vs-buy decision where the honest answer is "build," and seriously price ULID/UUIDv7 against Hashids before committing to salt management at all.

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