I have a selectbox(api_balance => have two item : manual, auto) and a input(balance) in view. I want to check if the value of api_balance is equal to manual, then it is necessary to enter the value for the input balance, otherwise it does not have a value, it does not show an error
protected $rules = [
'api_balance' => 'required',
'balance' => $this->api_balance === 'manual' ? 'required' : 'r',
];
I wrote the following code but it gives an error. What is the solution?