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

Shortid Doctrine Bundle Laravel Package

pugx/shortid-doctrine-bundle

Symfony bundle that integrates PugX ShortId with Doctrine ORM, giving entities short, unique, human-friendly identifiers generated automatically on persist. Ideal for clean URLs and readable public IDs.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Package identity check — read this first. The release notes are for PUGX/shortid-doctrine-bundle, which is a Symfony bundle providing a Doctrine ORM ID generator backed by the pugx/shortid-php library. It is not a Laravel package. It has no service provider, no facade, no config file published to config/, and no Eloquent integration. The assessment below treats it as a candidate PHP dependency inside a Laravel codebase, which is the only defensible framing.

  • Architecture fit (conditional / low by default). Laravel's default persistence layer is Eloquent. This bundle's entire value is a Doctrine #[ORM\CustomIdGenerator] class wired through Symfony's DI container. In a standard Laravel app, neither half of that is present. The only realistic fit is an application that already runs Doctrine via laravel-doctrine/orm — where you would use the bundle's generator class, but still not the bundle's Symfony wiring. Fit improves if the real requirement is short, URL-safe, non-sequential public IDs; it does not if the requirement is simply "nicer IDs" and an Eloquent-friendly alternative exists.
  • Integration feasibility (moderate, but not by installing this package). The bundle is not installable as-is into Laravel. A viable path is to depend on pugx/shortid-php directly and implement a Laravel-native layer (an Eloquent trait or a Doctrine\ORM\Id\AbstractIdGenerator subclass registered through the laravel-doctrine config). That is roughly a one-to-two-day spike, not a drop-in. If the goal is only to expose opaque IDs in a Laravel app, sqids/sqids or hashids/hashids reach the same outcome with less impedance.
  • Technical risk (low for the patch; medium for the adoption decision). v1.3.1 is a single-line maintenance fix for a Symfony 8 deprecation and carries no API or behavioural change. It is a positive maintenance signal but not an evaluation-changing one. The real risk is stack mismatch: Laravel's current major line ships Symfony 7.x components, so a fix aimed at Symfony 8 is ahead of the framework you'd be deploying into. That is harmless today but tells you the bundle's release cadence is paced by Symfony's majors, not Laravel's.
  • Key questions before any commitment.
    1. Is the actual requirement an Eloquent-friendly opaque public ID, or genuine Doctrine entity ID generation? Only the latter justifies looking at this package family.
    2. Does any part of the intended stack already use Doctrine? If no, the bundle is out of scope entirely and only the core shortid-php library is in play.
    3. What ID length/alphabet and collision budget does the product need? This drives configuration, not vendor choice.
    4. Are we prepared to own a small adapter layer rather than consume a supported package?
    5. What is the fallback if pugx/shortid-php stops receiving releases? Short IDs are cheap to reimplement, so the lock-in is low — but only if we don't leak the generator into persisted foreign keys.

Integration Approach

  • Stack fit. Poor as a direct dependency, workable as a source of a single class. Decision rule: if the app is Eloquent-first, evaluate sqids/sqids first and treat this package as a comparison point. If the app is Doctrine-backed under laravel-doctrine/orm, adopt the generator class and skip the bundle's DI extension.
  • Migration path. There is no migration to perform — there is no prior assessment and no existing usage. This is a greenfield decision, and the correct output of the evaluation is a yes/no on the ID strategy, not a cutover plan. Crucially, any adopted short ID format should be treated as irreversible once it is embedded in public URLs, stored in external systems, or shared with partners; decide the format before the first production write.
  • Compatibility. Verify PHP floor and Laravel major support explicitly against composer.json rather than inferring from the Symfony 8 fix. Confirm the Symfony component constraints resolve cleanly against the Laravel version in use; a Symfony 8-oriented constraint can conflict with Laravel's pinned Symfony 7 components and produce dependency-resolution friction. Check Doctrine ORM major version compatibility if the Doctrine path is taken.
  • Sequencing. (1) Confirm the persistence layer actually in use. (2) Run a half-day spike generating IDs against a throwaway table and verifying uniqueness under concurrent insert. (3) Decide format and length, and freeze it. (4) Only then implement the adapter in one place behind an interface, so the underlying generator remains swappable. (5) Load-test the collision-retry path before exposing IDs in user-facing URLs.

Operational Impact

  • Maintenance. Small, volunteer-driven maintainer base with a low release cadence and patch-level changes. v1.3.1 is housekeeping, which is reassuring for stability but does not indicate active feature development. Budget for the adapter layer being your code, not theirs.
  • Support. Community issues only, no vendor SLA, no commercial backing. Acceptable for a non-critical ID helper; not acceptable for anything on the transaction critical path without an in-house fallback.
  • Scaling. ID generation is local and CPU-cheap, so generation is not a scaling concern. Collision probability is a pure function of alphabet size and ID length — at short lengths with a 62-character alphabet, collision rates become non-negligible as row counts grow, and every collision costs a failed insert plus a retry. Choose length against projected row count at five years, not today's volume. Also consider case-sensitivity and ambiguous characters if IDs appear in URLs or are read aloud.
  • Failure modes. (a) Unique-constraint violation on collision if the retry loop is absent or bounded too tightly — surfaces as intermittent 500s under load, which is the classic hard-to-reproduce bug. (b) Format drift if different code paths generate IDs with different configuration, producing unparseable or inconsistently lengthed identifiers. (c) Silent coupling if the generator is called ad hoc across the codebase instead of behind one interface, making a future swap a wide refactor. (d) Dependency-resolution breakage when Laravel's Symfony component pins move.
  • Ramp-up. Low for any PHP developer — the concept is a base-conversion with a shuffled alphabet. The real ramp-up cost is whatever the team does not already know: Doctrine's ID generator lifecycle if the Doctrine path is taken. If the team is Eloquent-only, that learning cost exceeds the benefit of this package and argues for a Laravel-native alternative.
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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin