laravel-validated-dto
laravel-validated-dto copied to clipboard
How to access request input during validating?
Hi, @WendellAdriel
When writing validation rules inside a DTO, sometimes I need to refer to other fields. How can I access them — or, in other words, how can I access the $request? Like this:
[
'role_id' => Rule::requiredIf($request->user()->is_admin),
]