crtl/request-dto-resolver-bundle
$request->request->get() calls).400 Bad Request with violation details)."This package lets us build APIs faster and more reliably by automating request validation and reducing boilerplate. Instead of manually parsing and validating request data in every controller (e.g., $request->query->get('age')), we define type-safe DTOs once and let the system handle the rest. This cuts development time, improves code quality, and ensures consistent error responses for our APIs. For example, a complex endpoint with 10 validation rules could shrink from 50+ lines of code to just a few lines using a DTO. It’s a low-risk investment with high ROI for backend teams."
*"This bundle replaces manual request parsing and validation with a declarative DTO pattern. Key benefits:
@Assert\NotBlank) once in the DTO, reuse across controllers.string vs. int query params) with clear error messages.POST /orders with a Customer and Items[] DTO).public function createOrder(Request $request): Response {
$data = $request->request->all();
$validator = $this->validator->validate($data, ...);
// ...
}
Use this:
public function createOrder(OrderDto $dto): Response {
// $dto is auto-validated and hydrated
}
It’s cleaner, safer, and more maintainable—especially for APIs with many endpoints."*
How can I help you explore Laravel packages today?