'required|string', 'authentication_code' => [ 'nullable', 'numeric', Rule::requiredIf(function () { return empty($this->input('recovery_token')); }), ], 'recovery_token' => [ 'nullable', 'string', Rule::requiredIf(function () { return empty($this->input('authentication_code')); }), ], ]; } }