๐ Stop Guessing Your IDs: Generate Smart, Human-Friendly Sequence Numbers in Laravel
Auto-increment IDs work for databases, but not for business-facing numbers like invoices, orders, or tickets. When you need readable formats, yearly resets, or branch-wise counters, naive solutions...

Source: DEV Community
Auto-increment IDs work for databases, but not for business-facing numbers like invoices, orders, or tickets. When you need readable formats, yearly resets, or branch-wise counters, naive solutions break fast under concurrency. hatchyu/laravel-sequence gives Laravel a transaction-safe way to generate smart, customizable sequence numbers. Hereโs what the package supports: concurrency-safe increments prefixes and zero padding custom format templates callback-based formatting grouped counters by tenant, branch, year, day, or parent model bounded ranges and cycling sequences automatic assignment on Eloquent models event dispatching when a number is reserved If your app creates invoices, orders, tickets, admissions, customer codes, receipt numbers, or any other human-readable running number, this package is designed for that problem. ๐ต Why Sequence Numbers Break in Real Laravel Apps A lot of projects start with something like this: $next = Invoice::max('number') + 1; or: $next = Invoice::c