- Can I install respect/validation-bundle in a Laravel application?
- No, not as a runtime dependency. respect/validation-bundle is a Symfony bundle, and Laravel does not boot Symfony bundles or consume their container and configuration wiring. Installing it in Laravel would not expose usable validators and would add Symfony-specific coupling. Treat it as a reference implementation, not a Laravel package.
- Is respect/validation-bundle a Laravel package or a Symfony bundle?
- It is a Symfony bundle. Its purpose is to register the framework-agnostic Respect\Validation library as a Symfony service and make it configurable through Symfony bundle settings. The underlying respect/validation library can be used in Laravel, but the bundle layer cannot.
- What should Laravel developers use instead of respect/validation-bundle?
- Use Laravel's native Illuminate\Validation pipeline as the primary interface. If you specifically need Respect\Validation rules, install the standalone respect/validation Composer package and wrap the rules you need in Laravel Rule objects or a dedicated validator service. Do not import Symfony bundle configuration semantics into Laravel.
- Does respect/validation-bundle support Laravel 10 or Laravel 11?
- There is no stated Laravel version support because the package is a Symfony bundle, not a Laravel package. Its Composer constraints target Symfony and PHP versions, not Laravel. For Laravel 10 or 11, evaluate the standalone respect/validation package and test its PHP constraint against your application instead.
- How do I install and configure respect/validation-bundle?
- Installation is through Composer and Symfony bundle registration, typically enabling the bundle in a Symfony kernel and configuring it through bundle settings. That workflow does not apply to Laravel, which uses service providers and config files instead. In Laravel you would not install the bundle; you would register a small adapter service provider for standalone Respect rules.
- Can I use Respect\Validation rules in Laravel without the Symfony bundle?
- Yes. The respect/validation library itself is framework-agnostic and can be installed directly with Composer. You can call its fluent rule API inside a Laravel Rule object, a form request, or a custom validator service. This keeps Laravel's error bag, localization, and validation lifecycle intact.
- What are the production risks of adding respect/validation-bundle to Laravel?
- The main risks are duplicate validation stacks, inconsistent error-message behavior, missing Laravel error-bag integration, and extra glue code your team must own. You may also hit dependency conflicts because the bundle carries Symfony constraints that add no value in Laravel. The repository also has weak adoption signals, so long-term maintenance is uncertain.
- How should I test a Laravel adapter for Respect\Validation rules?
- Test the adapter, not the Symfony bundle. Cover rule construction, pass and fail cases, nested array input, error message output, and localization behavior against Laravel's validator expectations. Add regression tests for any custom Rule objects and confirm that failures appear correctly in Laravel's error bag.
- What is the difference between respect/validation and respect/validation-bundle?
- respect/validation is the standalone, framework-agnostic rule library. respect/validation-bundle is a Symfony integration layer that registers that library as a service and exposes Symfony bundle configuration. For Laravel, only the standalone library is relevant, and even then only if Illuminate\Validation cannot meet a concrete requirement.
- When does it make sense to adopt Respect\Validation in a Laravel project?
- Adopt it only when you have a specific validation rule or fluent rule-composition need that Laravel's native validator does not handle well. Start with a small proof of concept that wraps one or two high-value rules as Laravel Rule objects. Avoid migrating existing Illuminate\Validation rules wholesale, and document the Symfony bundle as reference-only.