pgs-soft/hashid-bundle
Symfony bundle that integrates Hashids to encode and decode numeric IDs, helping obfuscate database identifiers in URLs. Provides a configurable service and Twig filters for generating short, unique hashes in templates and routes, with simple bundle configuration.
hashids/hashids so integer route params (/order/1042) render as short opaque strings (/order/kJ4x9P). It lets you keep integer primary keys and avoid a schema migration while still shipping non-enumerable links.hashids/hashids library is the product; this bundle is a thin Symfony DI/configuration layer (service definition, YAML config, optional Twig/param converter integration). Buying is rational only because build cost is roughly a day — not because the integration is hard to replicate. If you are not on Symfony, you buy the base library directly and skip this package.Adopt when all of the following hold:
0 dependents plus 13 stars means no community has stress-tested it outside Symfony. On Laravel, depend on hashids/hashids directly and register it in a service provider; that is the same amount of work.Look elsewhere when:
UriSigner. Hashids with a leaked salt is trivially decoded.symfony/uid), which also solve distributed-generation.sqids is the successor concept to hashids and worth comparing; the original hashids spec is frozen but stable.For executives (30 seconds): Our public links currently expose sequential numbers, which tells anyone watching how many customers, orders, or tickets we have, and lets competitors walk our catalogue by changing one digit. This package replaces those numbers with short scrambled strings — same URLs, no database change, roughly one day of engineering. The risk profile is low: the licence is MIT, the algorithm is a stable published standard, and the integration layer is thin enough that we can replace it in-house in a single afternoon if the project goes quiet. It is not a security control — treat it as presentation, not protection.
For engineering (the honest version): This is a Symfony bundle wrapping hashids/hashids, with a low adoption signal (13 stars, 0 known dependents, last release April 2023). Do not mistake it for a maintained framework component. Recommended posture: adopt it as a thin convenience layer with a documented exit ramp — isolate hashid encoding/decoding behind our own PublicIdEncoder interface, register the base library as a service, and let the bundle be an implementation detail. That gives us the config ergonomics today and full ownership whenever we want it, at almost no cost. Explicitly out of scope: authorization, signed URLs, secrets, PII. Add contract tests around decode-failure behaviour (malformed and unknown hashes must 404, not 500) and around the salt being environment-configured and rotated per environment. If the route layer is Laravel rather than Symfony, skip the bundle and wire the base library ourselves.
How can I help you explore Laravel packages today?