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

Validator Bundle Laravel Package

phpmentors/validator-bundle

A Symfony bundle from PHP Mentors that adds flexible validation support to your application, integrating with Symfony's validation component and offering reusable constraints for validating domain objects, forms, and request data.

View on GitHub
Deep Wiki
Context7

Validation enhancements for Symfony applications

Frequently asked questions about Validator Bundle
Is phpmentors/validator-bundle compatible with Laravel?
No. phpmentors/validator-bundle is a Symfony bundle built around Symfony's Bundle lifecycle, dependency-injection extension, and configuration tree, and it has no Laravel service provider or framework-agnostic factory. Laravel does not register Symfony bundles, so there is no seam for the package to boot in a Laravel app. It also assumes symfony/validator rather than Laravel's Validator, FormRequest, and Rule contract.
Can I install phpmentors/validator-bundle in a Laravel 10 or 11 application?
Composer may or may not resolve the package beside a modern Laravel app, but resolution is not the same as compatibility. The release supports Symfony 2.8, 3.x, and 4.x with no Symfony 5 or 6 support, and its Symfony-4-era constraints likely collide with a PHP 8.1+ Laravel baseline. Even if dependencies resolved, the bundle still needs symfony/framework-bundle, symfony/dependency-injection, and symfony/config to boot, which is disproportionate for a thin validation wrapper. For Laravel 10 or 11, treat it as not installable without a fork or port.
What Symfony versions does phpmentors/validator-bundle support?
v1.3.0 moves the constraint to Symfony 2.8.0 or 3.0.0 or 4.0.0 or greater, and it does not add Symfony 5 or 6 support. The practical ceiling is Symfony 4, whose 4.4 security support window closed in November 2023. So it can fit a legacy Symfony 3 or 4 application but is pinned to an end-of-life line.
Does phpmentors/validator-bundle work with PHP 8.1 or PHP 8.2?
The exact php constraint after v1.3.0 is not confirmed in the release notes, and that constraint is the deciding factor for installability. A Symfony-4-era constraint set typically implies PHP 7.1 through 7.4, which collides with a PHP 8.1+ Laravel baseline at the Composer solver level. Run composer why-not against your target PHP and Laravel versions before assuming it will install. The package does not document a PHP 8.1 or 8.2 support commitment.
What does phpmentors/validator-bundle add over symfony/validator?
The context does not enumerate the actual class list or public API, so the exact delta over symfony/validator is still unverified. It is described as validation enhancements that integrate with Symfony's validation component and offer reusable constraints for domain objects, forms, and request data. Before adopting it, inspect the source for concrete constraints, exception semantics, and nested-object traversal. If those are capabilities you need, compare them directly against Symfony's built-in constraints and Laravel's Rule objects.
How do I install phpmentors/validator-bundle?
In a Symfony application, installation is a Composer require plus Symfony bundle registration, typically in AppKernel for Symfony 3 or config/bundles.php for Symfony 4. The bundle also relies on symfony/framework-bundle, symfony/dependency-injection, symfony/config, and symfony/validator. There is no Laravel package discovery, service provider, or publishable config, so the same steps do not translate to Laravel.
Is phpmentors/validator-bundle maintained and safe for production?
The maintenance profile is weak: 8 stars, 0 dependents, one contributor landing one PR, and no security-patch stream, backport path, or community to absorb breakage. v1.3.0 is a sign of life rather than an active maintenance stream, and it introduces no forward path beyond Symfony 4. BSD-2-Clause is permissive and legally clean, but production use would still require owning the risk. For a new Laravel project, it is not a safe dependency choice.
Are there Laravel alternatives to phpmentors/validator-bundle for reusable validation rules?
Yes. Laravel's validation layer covers the same problem space with FormRequest for boundary validation, Rule objects for reusable constraints, Validator::after for cross-field logic, validateWithBag for multi-form error bags, and first-class nested and array validation. Those features are native to the framework and do not require pulling Symfony FrameworkBundle into the app. If you like the bundle's domain-object validation pattern, port that pattern into a custom Rule or a small validation service rather than adopting the Symfony bundle.
Can I use phpmentors/validator-bundle constraints for domain object validation in Laravel?
Not directly. The constraints live inside a Symfony bundle that presumes symfony/validator and Symfony's bundle bootstrapping, while Laravel validates through its own Validator, FormRequest, and Rule contract. You could read the source and reimplement equivalent constraints as Laravel Rule objects, but the package itself provides no Laravel integration. The realistic path is a port, not a dependency.
How would I port phpmentors/validator-bundle patterns to Laravel?
Start by enumerating the package's public constraints and the validation-invocation logic, then map each reusable constraint to a Laravel Rule or a closure-based rule. Replace Symfony bundle configuration and service wiring with a Laravel service provider only if you need container bindings, and use FormRequest for request-boundary validation. Add tests against Laravel's Validator to pin the expected exception and error-message semantics, and assign an owner for the ported code. This avoids dragging symfony/framework-bundle into the application.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections