Required field validation in patch method

In the API I am developing, I need to call a patch method to update some user information.

I wonder if it’s possible to check if the field is only required if it’s in the request.

I know that in laravel there is a validation called sometimes, does Adonis have something similar?

I wonder if it’s possible to check if the field is only required if it’s in the request.

You can use a validator to set that field as required or not. And you can check if the info is in the request as you check for the presence of any JavaScript variable