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

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. Hard floor at Symfony 6.2 — any service on Symfony 4.4 or 5.4 LTS is now cut off from patch/feature releases of this bundle and must pin 3.1.*. That is a support-lifecycle decision, not a code decision.
  2. Resolver semantics drift — the old and new resolver contracts differ in how they signal "cannot resolve" versus "resolved to null" versus "throw." A change here converts a previously-404 invalid hash into a 500, or worse, silently passes an unconverted string into a controller typed against an integer/domain object. This is the failure mode most likely to escape a shallow test suite.
  3. Maintainer concentration — a one-contributor, one-PR major release on a small utility bundle is normal for the ecosystem but means no backport path if v4.0.0 has a regression.

Key questions.

  • Which of our PHP services are Symfony, and what versions? Anything below 6.2 makes this release a non-event for us.
  • Does the bundle's public surface (attribute name, service ID, config keys) change, or only internals? Release notes say only the mechanism, but this must be confirmed against the diff/UPGRADE notes.
  • Is there a documented deprecation path from 3.1.0, or is v4 a hard cliff?
  • What is the bundle's PHP version floor now (Symfony 6.2 implies PHP ≥ 8.1)? Does that constrain any service still on PHP 8.0?
  • Are there existing integration tests covering invalid/forged hash input on every route that uses the resolver?

Integration Approach

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:

  1. Inventory services declaring the dependency and record Symfony/PHP versions.
  2. For each candidate, bump Symfony to ≥ 6.2 first (ideally to 6.4 LTS), then bump the bundle — do not attempt both in one commit.
  3. Remove any application code that extends or decorates the bundle's old argument/resolver classes; those classes no longer exist.
  4. Run the route-level test suite with emphasis on negative cases (malformed hash, empty segment, hash of wrong entity type).

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.

  • Now: pin all Symfony <6.2 services to 3.1.* explicitly so nothing floats into v4 by accident.
  • Next: upgrade the highest-traffic Symfony service to 6.4 and take v4 there as the canary.
  • Then: roll v4 to remaining 6.4/7.x services once the canary has run a full release cycle.
  • Parallel: for Laravel services, standardize on the direct library and write down the salt/parameter contract in shared documentation so identifiers remain portable across both estates.
  • Last: decommission 3.1.x once no Symfony 5.4 service remains.

Operational Impact

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.

  • Resolver regressions — invalid or forged hash segments producing 5xx instead of 404, or unconverted values reaching typed controller arguments. Highest-likelihood risk of this release; mitigate with negative-path route tests.
  • Silent dependency drift — an unpinned service resolving to v4 on a Symfony 5.4 host and failing at container compile time. Mitigate with explicit pins.
  • Salt rotation — changing the salt invalidates every previously issued identifier simultaneously; all external links, bookmarks, and stored encoded values break at once. This is an operational landmine independent of v4, but a framework migration is exactly when someone is tempted to "tidy up" config. Freeze the salt during the upgrade and treat any change as a separate, fully-planned event with a re-encoding strategy.
  • Maintainer bus factor — a single-maintainer bundle with no backport path. Mitigate by keeping the integration thin enough that forking or inlining the resolver is a half-day job.

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.

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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource