haruncpi/laravel-id-generator
Laravel ID Generator creates unique, customizable IDs for database records. It supports prefixes, suffixes, fixed lengths, and sequence resets, making it easy to generate invoice, order, ticket, and other formatted IDs without manual tracking.
INV-2024-00042 instead of a UUID." This directly affects support workflows, verbal reference over phone, and CSV/report readability — a real UX and ops-cost lever, not just a database detail.SELECT MAX(...) + string formatting. The decision it informs is whether formatted-ID generation deserves a third-party dependency at all, or whether it belongs in a small internal trait/base model. Default position: it's a commodity — own it.Reasonable fit when:
Look elsewhere when:
AUTO_INCREMENT, Str::ulid() (Laravel 9+), ramsey/uuid, or a small in-house trait. All are lower-risk than an unmaintained dependency.Verdict: Adopt only as vendored code in a legacy context, or not at all. For a new build, reimplement — the maintenance burden is under a day and the dependency risk is permanent.
For executives: This is a small, single-purpose utility for making database IDs human-readable — invoice numbers people can read over the phone instead of UUIDs. It's cheap to try but effectively unmaintained since 2019, so I don't want it as a long-term dependency. Recommendation: approve it only for legacy or internal tooling, and allocate roughly half a day for engineering to vendor the code or reproduce it in-house. Do not put it on the roadmap as infrastructure — nothing strategic depends on it, and the "buy" option here is barely cheaper than the build.
For engineering: Small, readable API surface — prefix + date + padded sequence per model. Two things to flag before adoption: no release since October 2019 (verify against your Laravel/PHP version before committing), and generation is a non-atomic read-max-then-insert, so it needs a unique constraint and duplicate-retry handling under any real concurrency. If we proceed: vendor it, pin the version, add a concurrency test, and document the ID format as a stable contract with downstream consumers. If we're greenfield, a 30–60 line trait or Str::ulid() gives us the same outcome with no external dependency and no abandonment risk.
How can I help you explore Laravel packages today?