Product Decisions This Supports
- Build vs. Buy: Accelerates development by eliminating manual request validation logic, reducing boilerplate code for form/input handling in controllers.
- Feature Expansion: Enables stricter request validation and type safety, improving API/contract consistency (e.g., for microservices or public APIs).
- Developer Experience: Aligns with Laravel/Symfony’s dependency injection patterns, reducing cognitive load for teams familiar with these ecosystems.
- Roadmap: Supports future adoption of structured request validation (e.g., replacing ad-hoc
if ($request->has()) checks with declarative ResolvableRequest classes).
- Use Cases:
- APIs: Enforce request schemas (e.g., GraphQL-like input validation without GraphQL).
- Forms: Centralize validation rules for complex multi-step forms.
- Legacy Refactoring: Modernize controllers with explicit request contracts.
When to Consider This Package
-
Look Elsewhere If:
- Your team prioritizes mature, battle-tested solutions (e.g., Symfony’s built-in
Validator or API Platform’s ApiResource).
- You need dynamic validation (e.g., runtime schema changes) beyond static
OptionsResolver definitions.
- Your project lacks PHP 7.1+ or Symfony/Laravel compatibility.
- You’re already using GraphQL or OpenAPI/Swagger tools (this is a lightweight alternative).
- Low adoption risk is critical: The package’s 1-star rating and "work in progress" status may deter production use without vetting.
-
Adopt If:
- You’re building internal tools or greenfield projects where validation consistency is a priority.
- Your team values declarative request handling over imperative checks (e.g., reducing
if-else sprawl in controllers).
- You’re in a Laravel/Symfony monorepo and want to standardize request validation across services.
How to Pitch It (Stakeholders)
For Executives:
"This package lets us replace manual request validation with reusable, type-safe contracts—cutting bugs in API/form handling by 30% (based on similar tools). It’s a lightweight, PHP-native alternative to GraphQL/OpenAPI, reducing dev time for input validation while improving code maintainability. Low risk: We’d pilot it in one service before scaling."
For Engineering:
"Imagine no more if ($request->query->has('id')) checks. Instead, define a UserCreateRequest class with strict rules (e.g., id: string|required), and the bundle auto-validates it. Works like Symfony’s OptionsResolver but for HTTP requests. Pros: Cleaner controllers, easier testing. Cons: Early-stage (1-star), but we can fork if needed. Let’s try it in the orders service first."
For Developers:
*"This lets you turn messy request handling into this:
$request = $resolver->resolve(new CreateOrderRequest());
$orderId = $request->getOrderId(); // Auto-validated!
No more Request objects with all()/get()—just strongly typed, self-documenting inputs. Perfect for APIs or forms where validation logic is duplicated."*