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

Laravel Sqids Laravel Package

red-explosion/laravel-sqids

Laravel Sqids generates short, unique, obfuscated IDs from integer keys, keeping database IDs hidden in URLs and APIs. Includes route model binding, validation rules, and simple configuration for a seamless drop-in integration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for public ID formatting. The package solves one narrow problem — turning sequential database IDs into short, non-sequential-looking strings for URLs and API payloads — with a single Composer dependency. Default position should be "buy" (adopt) unless you already have a ULID/UUID strategy in place.
  • Whether to expose raw auto-increment IDs. Directly informs the decision to stop leaking /orders/10432 style identifiers in customer-facing links, emails, and API resources. This is a user-visible product change (short links, cleaner share URLs) with a security-hygiene upside (no trivially enumerable IDs, less leakage of business volume to competitors).
  • Framework upgrade roadmap. v2.1.0 adds Laravel 13.x support. For teams tracking Laravel releases, this removes a dependency as a blocker for the next major framework upgrade — a concrete roadmap input, not just housekeeping.
  • Avoiding a costly ID migration. If the alternative is re-keying tables to UUIDs/ULIDs, this package lets you keep integer primary keys (and their index/join performance) while changing only the presentation layer. That is a materially cheaper path and worth pricing out explicitly.
  • Use-case fit: share/invite links, public API resource identifiers, invoice and order references, referral codes, any place a short opaque token improves UX or reduces enumeration.

When to Consider This Package

Adopt when most of these hold:

  • You use Laravel (9.x–13.x) and standard auto-increment integer primary keys.
  • Your public surface currently exposes sequential IDs in URLs, JSON, or emails.
  • You want short, copy-pasteable identifiers rather than 36-character UUIDs.
  • You want route-model binding, Eloquent casts, and validation rules to work without bespoke glue code.
  • You can accept the dependency being small and single-maintainer-ish; v2.1.0 landing Laravel 13 support via an external contributor PR is a reasonable signal of upkeep, but pin the version and read the changelog on each bump.

Look elsewhere when:

  • You need secrecy. Sqids is encoding, not encryption — the output is reversible by anyone who knows the alphabet. If the ID is a bearer-style secret (password reset, signed download, entitlement token), use signed URLs, random tokens, or UUIDv4 instead.
  • You need unguessability guarantees or compliance-grade non-enumerability. No key/secret protects the mapping; a determined party can decode and enumerate.
  • You want DB-level uniqueness/sortability. ULIDs/UUIDv7 give you sortable, globally unique keys generated before insert; Sqids only decorates existing integer keys.
  • You need high-throughput bulk encoding/decoding in hot paths — benchmark before committing.
  • You already committed to UUID/ULID public identifiers — adding Sqids on top is redundant surface area.

How to Pitch It (Stakeholders)

For executives: This is a small, low-risk library that lets us keep our current database structure while making customer-facing links and IDs short and non-sequential — cleaner share links, no leaking of order/customer volume, and no expensive primary-key migration. The v2.1.0 release is routine maintenance: it adds support for Laravel 13, so this dependency will not hold up our next framework upgrade. No breaking changes, no new infrastructure, no operational cost.

For engineering: One Composer dependency; v2.1.0 is a non-breaking minor that extends the supported framework matrix to Laravel 13.x. Before adopting, be explicit that Sqids is reversible encoding, not encryption — it must not be used for secrets or authorization tokens. Verify the cast/route-binding/validation API against our Laravel version, pin the version, and confirm bulk-encode performance if we plan to apply it to high-volume API resources. Recommend a scoped rollout (one resource type first) rather than a blanket change to all identifiers.

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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource