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

Consistence Bundle Laravel Package

mhujer/consistence-bundle

Symfony bundle integrating the Consistence library, adding strict typing, enums, and value object support to your Symfony app. Provides service and Doctrine integration for cleaner domain models.

View on GitHub
Deep Wiki
Context7

ConsistenceBundle adds translator service, translator twig filter and form type for Consistence Enums

Frequently asked questions about Consistence Bundle
Is mhujer/consistence-bundle a Laravel package?
No. It is a Symfony bundle that integrates the Consistence library and wires a translator service, Twig filter, and form types through Symfony bundle and DI conventions. Laravel has no bundle registration or symfony/form integration, so the package does not activate in a Laravel app. Treat it as a reference implementation rather than a Composer dependency for Laravel.
Can I install mhujer/consistence-bundle in a Laravel application?
Composer may resolve it alongside Laravel's Symfony components, but installing symfony/framework-bundle just to get enum labels is a disproportionate dependency and increases attack surface. The bundle's services, translator decorator, and form types are Symfony-specific and will not be used by Laravel's container or form layer. For Laravel, reimplement the small enum-to-label pattern in app code instead.
How do I translate Consistence enum values in Laravel?
Create an EnumTranslator service that wraps Laravel's __() or Translator::get() using a deterministic key convention such as enums.{class}.{value}. Fall back to the raw enum value when a translation key is missing so the UI degrades predictably. Inject that service into Blade components or form requests, and keep the catalog keys stable because persisted enum values are a data contract.
What Laravel validation rule replaces the bundle's enum form type?
For native PHP backed enums, use Laravel's Rule::enum() validation rule. For legacy Consistence enums, write a custom rule that checks the submitted value against the enum's getAvailableValues() list. Pair either rule with a Blade select component that derives its choices from the same enum value list to keep validation and UI in sync.
Does mhujer/consistence-bundle support Laravel 10 or Laravel 11?
No. The bundle is pinned to the Symfony 3/4 era and its underlying Consistence library carries PHP 7.x-era constraints, so it is not a supported Laravel 10 or 11 dependency. Running it on PHP 8.2 or 8.3 raises deprecation and static-analysis friction with no upstream fix path. Use native backed enums and Laravel's own validation and translation features instead.
How do I migrate from Consistence enums to native PHP enums in Laravel?
Inventory every enum and classify it as single-value, multi-value, or already native. Extract definitions into app/Enums with no Symfony or Laravel imports, using string-backed native enums where PHP 8.1 or newer is available. Keep string values byte-identical to the legacy constants to protect persisted data, then build the Laravel adapter and parity tests before removing the bundle from any Symfony service definitions.
What are alternatives to mhujer/consistence-bundle for enum labels?
There is no direct Laravel equivalent because the bundle's value is mostly Symfony wiring around translation catalogs. In Laravel, native backed enums plus translation keys, Rule::enum(), and a small Blade select component cover the same ground. If you need shared enum definitions during a Symfony-to-Laravel migration, put them in a framework-agnostic package or app/Enums namespace.
Is mhujer/consistence-bundle maintained and safe for production?
The project shows high abandonment risk: one star, zero dependents, a single maintainer, and an opportunity score of 17.5. The MIT license is clean, so forking is legally possible, but there is little evidence of ongoing support or PHP 8.x compatibility work. For a Laravel production app, avoid adding it as a dependency and reimplement the tiny pattern you need.
How do I handle MultiEnum or multi-value enums in Laravel?
Native backed enums do not express bitmask or combined-value sets directly. Represent a multi-value field as an array of enum cases, validate each case individually, and store either a JSON array or a bitmask with an explicit mapping layer. If existing data uses Consistence MultiEnum bitmasks, preserve the numeric values and document the mapping before switching to native enums.
How should I test enum label parity during a Symfony to Laravel migration?
Build a parity test that compares the label output for every enum case in every supported locale between the Symfony implementation and the Laravel EnumTranslator. Use a data provider so new cases and locales are automatically covered, and assert the fallback behavior for missing translation keys. Remove the bundle from composer.json only after the parity suite is green.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
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