Custom rule depended on other field

Is it possible to use ->rule() on form input when it is depended on other field, for example if phone number validation is dependant on selected country.
Thank you for the help!
Was this page helpful?