roukmoute/hashids-bundle
Symfony bundle integrating Hashids to encode and decode numeric IDs into short, unique, obfuscated strings. Configure salt, length, and alphabet, then use services or Twig filters to hide database IDs in URLs.
Scope of the change. v4.0.0 is a single-PR release that swaps the bundle's argument-resolution mechanism from Symfony's legacy ArgumentInterface/ArgumentMetadata resolver to the ValueResolverInterface introduced in Symfony 6.2. The underlying hashing behavior (hashids/hashids, salt, min-length, alphabet, encode/decode output) is untouched — this is an integration-layer change, not an algorithm change. That is the most important fact for risk sizing: encoded identifiers already persisted in URLs, DB rows, or emails remain valid.
Architecture fit. This is a Symfony bundle, not a Laravel package. It has no service provider, no facade, no config/hashids.php publish tag in the Laravel idiom — it registers a Hashids service and a controller-argument value resolver through Symfony's DI container and the kernel.event/controller.argument_value_resolver tag. For a Laravel-centric estate the bundle is therefore not directly consumable; the reusable asset is the upstream hashids/hashids library, with the bundle serving as a reference implementation of the wiring. If the org runs Symfony services alongside Laravel (common in polyglot PHP shops post-acquisition or during incremental migration), the bundle is appropriate for those services only.
Integration feasibility. Straightforward if and only if the host framework is Symfony ≥ 6.2. The migration is mechanical: composer constraint bump, remove any local overrides of the old argument/resolver classes, run the test suite, verify controller signatures that relied on the previous argument attribute. There is no database migration, no config schema change, and no data backfill. Estimated effort for a well-tested service: hours, not days.
Technical risk. Concentrated in three places:
3.1.*. That is a support-lifecycle decision, not a code decision.Key questions.
Stack fit. For Symfony services on 6.4 LTS or 7.x: adopt. For Symfony 5.4 LTS services: stay on 3.1.x and track the 5.4 EOL date as the forcing function. For Laravel services: do not introduce this bundle; use hashids/hashids behind a small dedicated service class bound in a service provider, and mirror the bundle's config surface (salt, min length, alphabet) in config/ so both estates behave identically.
Migration path. Treat this as a framework-alignment task rather than a library upgrade:
Compatibility. Encoded IDs and salts carry over unchanged, so external permalinks, emailed links, and stored hashes survive the upgrade — verify this explicitly with a round-trip test using production-sample values before rollout. Config key names and the attribute used in controller signatures should be diffed; if either changed, controller code must be touched and the change becomes a code-review burden rather than a composer bump.
Sequencing.
3.1.* explicitly so nothing floats into v4 by accident.Maintenance. Low absolute cost — a small bundle with a narrow surface. The recurring work is not patching it but keeping the framework floor satisfied. Budget a periodic dependency-review check rather than a standing owner; assign it to whoever owns PHP runtime currency.
Support. Upstream support for 3.1.x should be assumed to be minimal-to-none now that v4 exists. Any service left on 3.1.x is effectively on a frozen dependency, which is acceptable for a stable utility but must be a recorded, time-boxed exception tied to the Symfony 5.4 EOL.
Scaling. The bundle's runtime profile is negligible — a single value resolver invocation per parameter, no I/O, no caching layer. Scaling concerns are unrelated to this package. The relevant scale question is identifier space: Hashids output length grows with volume and min-length settings, and if identifiers are embedded in fixed-width columns or indexed as CHAR(n), growth needs to be checked before traffic grows. That risk predates v4 and is unaffected by it.
Failure modes.
Ramp-up. A mid-level PHP engineer can own this in under a day, provided they already understand Symfony's controller argument resolution. Engineers coming from Laravel will not have that mental model — the value-resolver/attribute pattern has no direct analogue in Laravel's route model binding, and the failure mode (a resolver declining to resolve) is quiet. Pair the first migration with someone who has debugged Symfony's ArgumentResolver stack, and capture the round-trip and negative-path tests as the reusable artifact so subsequent services need only the checklist.
How can I help you explore Laravel packages today?