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

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

Hashids bundle

Frequently asked questions about Hashids Bundle
Is netbull/hashids-bundle compatible with Laravel?
No. netbull/hashids-bundle is a Symfony bundle that ships a Symfony Bundle class, DI extension, configuration tree, and Doctrine bridge, none of which Laravel auto-discovers or registers. The only reusable piece is the underlying hashids/hashids library, which you can wire into Laravel yourself with a service provider. Installing the bundle in a Laravel app adds dead weight rather than Laravel-native integration.
How do I install netbull/hashids-bundle in a Laravel application?
You should not install it for a Laravel application. Composer may install the package, but Laravel will not auto-discover a Symfony bundle or publish its netbull_hashids configuration, so there is no usable Laravel service or facade. The practical path is to require hashids/hashids directly and build a small Laravel adapter instead.
What configuration options does netbull/hashids-bundle provide?
The bundle exposes Symfony configuration under netbull_hashids for the salt, minimum hash length, and custom alphabet used by Hashids. Those options are validated and injected through Symfony's container, not Laravel's config system. In Laravel you would recreate the same settings in config/hashids.php and bind a configured Hashids singleton yourself.
Can I use Hashids in Laravel without the Symfony bundle?
Yes. Hashids is a small, stateless PHP library with no framework coupling, so you can require hashids/hashids and register a singleton in a Laravel service provider using values from config/hashids.php. A model cast or trait can expose a hashid attribute, and route binding or getRouteKey can resolve hashed values back to models. That approach is framework-native, license-clean, and typically a one-to-two-day build.
Does netbull/hashids-bundle support Laravel 10 or Laravel 11?
There is no Laravel version support because the package is built for Symfony, not Laravel. It provides no Laravel service provider, package discovery entry, facade, or publishable Laravel config. The underlying Hashids library supports broad PHP 7.4 and 8.x runtimes, but that does not make the bundle Laravel-compatible.
Is netbull/hashids-bundle safe for production use?
Treat it as high risk in a Laravel or SaaS context. The package is AGPL-3.0, has effectively zero adoption, and depends on Hashids, which is reversible obfuscation rather than encryption. Hashids can hide IDs in URLs, but it must never replace server-side authorization or become the only control protecting a resource. Legal review and a owned Laravel adapter are safer than adopting the bundle.
What license does netbull/hashids-bundle use, and can I use it in a SaaS?
It is licensed under AGPL-3.0, whose network-use clause can treat serving the software over a network as distribution and trigger source-disclosure obligations for the combined work. For SaaS or embedded products this usually requires explicit legal sign-off and may be a hard blocker under corporate OSS policy. Many teams avoid the question by using the underlying library under its own terms or implementing a clean-room Laravel adapter.
How do I test Hashids encoding and decoding in Laravel?
Test with a fixed salt, minimum length, and alphabet from a testing config so encoded values are deterministic. Unit-test the service's encode and decode methods for single IDs and arrays, then feature-test route binding and serialized hashid output. Keep production salts in a secrets manager and override them only in the test environment.
What are the best alternatives to netbull/hashids-bundle for Laravel?
For Laravel, the cleanest alternative is hashids/hashids wired through your own service provider, config file, and model cast or route binding. If you want Hashids' successor, evaluate sqids/sqids, which the Hashids author has steered users toward. For new systems, native UUIDv7 or ULID identifiers may remove the need for reversible obfuscation entirely.
Is netbull/hashids-bundle actively maintained?
A 2025-11 release shows the maintainer is still tagging versions, so it is not abandoned. However, adoption is effectively zero, there are no dependents or community test coverage, and the bus factor is one. Upstream Hashids is also feature-frozen, with its author pointing users to sqids, so longevity risk remains.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo