sylius/sequence-bundle
Sylius SequenceBundle generates and manages sequential numbering for Sylius resources, such as order numbers, with configurable generators and prefixes. It provides a flexible sequence system so each entity gets consistent, ordered identifiers.
Architecture fit. Effectively zero at the framework layer. sylius/sequence-bundle is a Symfony 2-era bundle — it assumes kernel registration, DI container compiler passes, service tagging, and Doctrine ORM entity discovery. Laravel has no equivalent boot path: no AppKernel, no bundle extension class, no service provider, no publishable config. Composer will install it, but nothing will load its services or hydrate its entities. The domain concept it encodes — a named, atomically incremented counter rendered through a format mask for order, invoice, and shipment identifiers — is directly relevant to any commerce or billing build, including Laravel. That concept is the leverage; the artifact is not.
Integration feasibility. Low as a dependency, high as a specification. The realistic TPM action is to treat the repository as a readable reference for sequence semantics (type key, monotonic index, format string applied at read time) and commission a native Laravel implementation instead. The core requirement maps cleanly to a sequences table with a type primary key plus an index column, incremented inside DB::transaction() with lockForUpdate(). That is a day or two of engineering, fully owned, with tests.
Technical risk. High, and concentrated in sustainment rather than runtime (the code will never execute). The repo is archived and READ-ONLY, pinned to an EOL Symfony and PHP generation, with four stars and zero dependents — no ecosystem validation, no prior art for failure modes, no CVE response. It is a read-only subtree split of the Sylius monorepo, so history and issues live upstream; forking it as a long-term dependency is not viable.
Key questions.
Stack fit. Do not composer require. Adopt the pattern, not the package. The sequence abstraction — named sequence, current value, atomic increment, display formatter — is the transferable asset and it is a small, well-understood problem that Laravel primitives handle better than a Symfony 2 bundle.
Migration path. (1) Read composer.json, Resources/config/services.xml, and the Model//Doctrine/ directories to extract the semantics; the PHP classes are thin and the wiring is where the behaviour lives. (2) Document what you actually need: sequence name, start value, stride, reset policy, format mask. (3) Implement a Sequence Eloquent model with a next(string $type, string $format) method wrapped in a transaction with a row lock. (4) Port formatting logic under MIT attribution where the license permits; default to a clean rewrite.
Compatibility. Assume incompatible with any modern Laravel stack. No service provider, no facade, no publishable config, and Doctrine annotations are invisible to Eloquent. Symfony 2-era PHP platform constraints will likely fail Composer resolution against a current composer.json before anything runs — and even if it resolves, the result is dead code.
Sequencing.
INCR with durable write-through) and benchmark under simulated concurrency.Where the leverage is. The package is most useful as a decision aid. It is a compact worked example of the "sequence definition + generator" separation, which makes it an efficient way to force the build-vs-buy conversation to a conclusion (build), and a concrete migration risk item if you are carrying a Sylius 1.x / Symfony 2 estate into a Laravel target.
Maintenance. Total ownership from the first commit if adopted; near-zero if used as a reference. The ongoing burden of the concept is small — a table, a transaction, a formatter — while the burden of the artifact is unbounded: every PHP upgrade, security review, and bug becomes yours against an archived repo with no maintainer.
Support. No vendor, no effective upstream tracker, no community to escalate to. Internal runbooks must be authored, not inherited. Any team inheriting the Symfony bundle without context will burn time discovering it cannot boot.
Scaling. The naive row-lock design serializes all writers per sequence and becomes a contention point at high order-creation volume; acceptable at low throughput, not at scale. Redis INCR scales horizontally but raises durability questions — a Redis loss can either reissue numbers (duplicates) or skip them (gaps), and neither is acceptable for invoices absent an explicit recovery policy. Native database sequences are the best middle ground where gaps are tolerated.
Failure modes. Duplicate values under read-modify-write races without proper locking; gaps on rollback when the counter is not co-transactional; counter exhaustion on 32-bit storage; drift between a cache-backed counter and its durable store after restart; and silent misformatting when padding or period-reset logic is ported incorrectly. Each of these is invisible until a finance or audit process trips over it.
Ramp-up. Low for the concept — a mid-level engineer can implement and test a correct generator in one to two days. High and wasted for anyone attempting to operate the Symfony bundle inside Laravel; time-box source review of the original to a few hours and redirect the effort to the native build.
Verdict. The 0.025 score is directionally correct: not an adoptable dependency, but a legitimate reference. Recommendation: do not adopt; extract the pattern. Escalate the product decision it surfaces — whether invoice and order numbers may contain gaps, and who may reset a sequence — as a compliance and audit call, independent of this package.
How can I help you explore Laravel packages today?