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
Sequence Bundle

Sequence Bundle Laravel Package

indragunawan/sequence-bundle

SequenceBundle provides configurable, database-backed sequence generation for PHP apps, with support for prefixes, suffixes, zero-padding, reset periods, and concurrency-safe counters—ideal for invoice, order, and document numbers.

View on GitHub
Deep Wiki
Context7

Sequence Implementation

Frequently asked questions about Sequence Bundle
Is indragunawan/sequence-bundle compatible with Laravel?
No. It is a Symfony bundle built around Symfony's dependency injection container, configuration trees, and a Bundle class loaded through bundles.php, and Laravel has no loader for that architecture. The package ships no Laravel service provider, publishable config file, or Laravel-format migrations. Treat it as a design reference rather than a Composer dependency for a Laravel application.
How do I install indragunawan/sequence-bundle in Laravel?
You cannot install it as a Laravel package in any meaningful way. Composer may fetch the code, but Laravel will not auto-discover a Symfony bundle or register its services. Wiring it up would mean pulling Symfony's DI container and likely Doctrine into your Laravel app, which is disproportionate for a number-generation utility. The practical path is to reimplement the sequence model natively with Eloquent and a small service class.
What does SequenceBundle actually do?
It stores named sequence counters in a database and increments them to produce formatted, human-readable identifiers. It supports prefixes, suffixes, zero-padding, date-based tokens such as INV/2024/00042, and reset periods. The core domain model is small: a sequence name, current value, increment, format rules, and reset policy.
What Laravel version does sequence-bundle support?
None officially. It targets Symfony 4.4/5.x-era applications, with the last release in March 2020. There is no Laravel service provider or version constraint covering Laravel 9, 10, or 11. Do not expect Laravel 11 compatibility or PHP 8.2+ support without a rewrite.
How can I generate invoice numbers in Laravel safely under concurrency?
Create a sequences table with a unique name, current_value, increment, reset policy, and last_reset_at, then increment inside a transaction using lockForUpdate(). That maps to SELECT ... FOR UPDATE and prevents the read-then-write race that produces duplicate numbers under load. The SequenceBundle concept is useful, but its Doctrine-based locking code is not directly reusable in Laravel.
Is sequence-bundle maintained and safe for production?
The last release was 2020-03-07, with a single maintainer and no commits in roughly five years. It has zero dependents, no community pressure to keep it alive, and no security response path. Even under the permissive MIT license, you would have no reliable way to get a CVE patched.
Can I use sequence-bundle with Eloquent instead of Doctrine?
Not as shipped. Its persistence almost certainly runs through Doctrine ORM/DBAL, and its locking calls differ from Laravel's Eloquent lockForUpdate(). Running both Doctrine and Eloquent means two ORMs, connection pools, and migration systems in one application. That blast radius is disproportionate for sequence generation, so a Laravel-native rewrite is cleaner.
What are the alternatives to sequence-bundle for Laravel sequence generation?
The main alternative is owning a small, well-tested sequence service in your app: a sequences table, an Eloquent model, and a locked transaction. Laravel-native packages or a custom implementation avoid the Symfony and Doctrine integration burden. SequenceBundle is best used as a reference for its configuration schema and reset policy design.
Does sequence-bundle support prefixes, suffixes, padding, and date tokens?
Yes, those are core features: configurable prefixes, suffixes, zero-padding, and date-based tokens such as INV/2024/00042. It also supports reset periods like none, daily, monthly, or yearly. In Laravel you would reproduce those rules in a formatter class or config file rather than consuming the bundle's Symfony configuration tree.
How hard is it to port sequence-bundle to Laravel?
It is a rewrite, not an integration. The transferable IP is the domain model, namely a named counter, increment, format and padding rules, and reset policy, which is on the order of a few hundred lines to implement idiomatically. Expect roughly a one-day spike for a sequences table, model, service, and locked transaction, but plan tests for timezone reset boundaries, rollback behavior, and padding overflow.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core