A Laravel bridge for Hashids, enabling simple encoding and decoding of integers into short unique strings.
Laravel Hashids is a Laravel package that integrates the Hashids library, allowing developers to encode integers into short, unique strings and decode them back. It solves the problem of exposing sequential integer IDs in URLs or APIs by providing obfuscated, non-sequential identifiers. The package offers a Laravel-native interface with facades and dependency injection support.
Laravel developers who need to obfuscate database IDs in URLs, APIs, or public-facing data, such as those building web applications with user-friendly or secure identifier requirements.
Developers choose Laravel Hashids for its seamless Laravel integration, simple API, and configuration flexibility, avoiding manual setup of Hashids while adhering to Laravel conventions. It provides a clean, maintainable way to implement ID obfuscation with multiple connection support.
A Hashids bridge for Laravel
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers facades and dependency injection support, aligning with Laravel conventions for easy adoption, as shown in the usage examples with Hashids::encode() and injectable HashidsManager.
Allows configuring different Hashids settings via connections in config/hashids.php, enabling flexible use cases like separate encodings for various application parts.
Provides publishable config files for customization without hacking package code, simplifying setup and maintenance as per the installation steps.
Maintains support for the established Hashids library while noting the Sqids alternative, ensuring stability for existing projects.
Relies on Hashids, which the README notes has been rebranded to Sqids—a newer alternative—making this package potentially less future-proof without native Sqids integration.
Only handles integer encoding/decoding; non-integer data requires manual conversion, which can be cumbersome for complex use cases.
Adds Laravel-specific abstraction; for basic encoding, direct use of Hashids or Sqids libraries might be lighter, as hinted in the README's note on Sqids not needing a package.