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.
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.
sqids/sqids); Hashids is feature-frozen. Betting on it is a small but real longevity risk.Key questions.
sqids (successor) or native UUIDv7 / ULID?.env in VCS)?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:
HashidsServiceProvider registering a singleton built from config/hashids.php (salt, min length, alphabet) sourced from the secrets manager.HasHashedId) exposing hashid in serialized output and resolving hash → model on route binding, so controllers never see raw integers.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.
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.
min_length or a truncated alphabet raises collision probability; enforce a floor and test it.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.
How can I help you explore Laravel packages today?