I have the following rule to only set my text field required if online is set to 1.
'required_if:online,1'
Now I'm wondering if it's possible to use this behaviour using a custom rule object, see: https://laravel.com/docs/6.x/validation#using-rule-objects
The following 2 attributes are available in the rule object: Attribute and Value
public function passes($attribute, $value)
{
//
}
Is it possible to check other fields that are included in the current request using this method?