Download the PHP package litepie/hashids without Composer
On this page you can find all versions of the php package litepie/hashids. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download litepie/hashids
More information about litepie/hashids
Files in litepie/hashids
Package hashids
Short Description Laravel Sqids (next-gen Hashids) package for encoding and decoding database IDs with route model binding support
License MIT
Homepage https://github.com/litepie/hashids
Informations about the package hashids
Litepie Hashids
A Laravel package for encoding and decoding database IDs using Sqids (next-generation Hashids). This package provides a clean way to obfuscate your database IDs in URLs and API responses while maintaining Laravel conventions.
Features
- ๐ข Encode/decode database IDs using Sqids (next-gen Hashids)
- ๐ก๏ธ Built-in profanity filter with customizable blocklist
- ๐ญ Eloquent model trait for automatic ID handling
- ๐ฃ๏ธ Route model binding support with encoded IDs
- โ๏ธ Signed IDs with expiration support
- ๐ง Helper functions for easy usage
- โ๏ธ Configurable alphabet, length, and blocklist
- ๐ Laravel 10, 11, and 12 support
- ๐งช Comprehensive test suite with Pest
- ๐ Full static analysis with PHPStan
- โก Better performance than traditional Hashids
Requirements
- PHP 8.2+
- Laravel 10.x, 11.x, or 12.x
- BCMath or GMP extension (automatically handled by Sqids)
Installation
Install the package via Composer:
The service provider will be automatically registered. To publish the config file:
Configuration
The configuration file config/hashids.php allows you to customize:
You can also set these values in your .env file:
Usage
Helper Functions
Facade
Eloquent Model Trait
Add the trait to your Eloquent models:
Available Methods
Route Model Binding
The trait automatically supports Laravel's route model binding:
Now you can use encoded IDs in your URLs:
Security
- The alphabet is automatically shuffled for uniqueness
- Built-in profanity filter prevents offensive words in IDs
- Signed IDs include salt verification and optional expiration
- IDs are obfuscated but not encrypted (don't rely on them for security)
- Customizable blocklist for additional word filtering
Why Sqids over Hashids?
This package uses Sqids instead of traditional Hashids, providing:
- โก Better Performance - More efficient algorithm
- ๐ก๏ธ Built-in Profanity Filter - Automatic offensive word prevention
- ๐๏ธ Custom Blocklist - Block specific words from appearing in IDs
- ๐ง Modern PHP - Optimized for PHP 8.2+
- ๐ Active Development - Regular updates and improvements
Testing
Running Static Analysis
Code Style Fixing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Lavalite Team
- All Contributors
License
This package is open-sourced software licensed under the MIT license.
Support
- Issues: GitHub Issues
- Documentation: README
- Source: GitHub Repository
๐ข About
This package is part of the Litepie ecosystem, developed by Renfos Technologies.
Organization Structure
- Vendor: Litepie
- Framework: Lavalite
- Company: Renfos Technologies
Links & Resources
- ๐ Website: https://lavalite.org
- ๐ Documentation: https://docs.lavalite.org
- ๐ผ Company: https://renfos.com
- ๐ง Support: [email protected]
Built with โค๏ธ by Renfos Technologies
Empowering developers with robust Laravel solutions
All versions of hashids with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
sqids/sqids Version ^0.5