Gap-free, concurrency-safe invoice and document numbering for PHP 8.1+ — 24 profiles, 6 document types, 4 reset regimes, zero dependencies.
composer require docnum/invoice-numbering
src/Format.phpsrc/ResetPolicy.phpsrc/DocumentType.phpsrc/Profile.phpsrc/Profiles.phpsrc/Numbering.phpsrc/GapReport.phpsrc/Store/SequenceStore.phpsrc/Store/InMemoryStore.phpsrc/Store/FileStore.phpsrc/Store/PdoStore.phpsrc/Exception/NumberingException.phpThis page is the working piece. The full pack has everything below.
24 numbering profiles across 6 document types and 4 reset regimes — the number is handed out once, even when two requests land in the same second.
Replacement cost is not the code, it is the concurrency proof: the race between two POST requests, the 1 January rollover, the {SEQ:5} width overflow at 100000, and adopting a legacy series without renumbering it — each one only s
Send it to me