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

Eloquent Hashids Laravel Package

matt-daneshvar/eloquent-hashids

Laravel package that adds Hashids support to Eloquent models, hiding auto-increment IDs behind short, reversible hashes. A trait encodes route keys and resolves models from hashids, keeping URLs clean and database IDs private with minimal setup.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Public identifier strategy: Decide whether user-facing URLs, API payloads, and exports should expose sequential database IDs or short obfuscated tokens. This package supports a quick “opaque-enough” ID layer for Laravel models without redesigning the schema.
  • API and URL design: Useful when product wants cleaner, shorter public references than raw integers, e.g. /orders/AbC123 instead of /orders/1042, while preserving internal integer primary keys.
  • Exposure and enumeration risk: Helps reduce casual enumeration of records and prevents public IDs from revealing volume, growth rate, or creation order. It is not a security control and should not be positioned as one.
  • Build vs. buy/borrow: The capability is small and MIT-licensed, so the real decision is “adopt this package” vs. “implement a tiny internal trait” vs. “use UUIDs/ULIDs.” Because the package is archived, adopting it is closer to borrowing a pattern than taking on a maintained dependency.
  • Migration and compatibility planning: Forces explicit decisions about backfilling existing records, salt management, ID rotation, uniqueness constraints, and API contract stability.
  • Support and analytics ergonomics: Short public IDs can improve customer support workflows and readable logs, but teams must ensure internal tooling can resolve both hashid and primary key.

When to Consider This Package

Consider it when:

  • You have a small-to-medium Laravel application using integer primary keys and want a lightweight way to add persisted, non-sequential public IDs.
  • The IDs are for convenience, aesthetics, or mild obfuscation—not authorization, secrecy, or compliance-grade unguessability.
  • The surface area is limited and the team is willing to vendor/fork the package or reimplement its small behavior internally.
  • You can tolerate the maintenance risk of an archived 2019 package and have verified compatibility with your Laravel/PHP version.
  • You have a clear plan for backfilling existing rows, managing salts, and preventing hashid reuse or drift.

Look elsewhere when:

  • You need cryptographically unguessable identifiers, strict non-enumerability, or security-sensitive external references—use UUIDs/ULIDs or a properly maintained ID scheme.
  • You need an actively maintained dependency with modern Laravel support, security patches, or vendor backing.
  • You have complex multi-tenant requirements, rotating salts, or external API contracts where changing IDs would break consumers.
  • You need authorization, auditability, or compliance controls; Hashids only obfuscate, they do not protect access.
  • Your scale or data model makes persisted derived IDs operationally risky without strong uniqueness, migration, and observability guarantees.

How to Pitch It (Stakeholders)

For executives: This is a low-cost utility to make public-facing record IDs shorter and less revealing than sequential database IDs. It can improve URL aesthetics and reduce casual data enumeration, but it is not a security feature. Because the package is archived and last released in 2019, I would not recommend adopting it as a long-term strategic dependency; if we want this behavior, we should treat it as a small internal pattern we own.

For engineering: The package auto-generates and persists Hashids for new Eloquent models. If we use it, we should verify Laravel/PHP compatibility, add a unique indexed hashid column, backfill existing records, define salt management, and test collision/rotation behavior. We must explicitly avoid using hashids for authorization or secrecy. Given the maintenance status, the safer path may be to copy the minimal trait behavior into our codebase or choose UUIDs/ULIDs if unguessability matters.

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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels