original_string: protected function replaceRequiredForRequiredWith(ValidationRuleDataInterface $rule, array $requiredWithKeys)
      {
          $rules = array_diff($rule->rules(), ['required']);
  
          // If there are no required_with keys to replace it with, leave the rule out
          if (count($requiredWithKeys)) {
  
              $rules[] = 'required_with:' . implode(',', $requiredWithKeys);
          }
  
          $rule->setRules($rules);
      }
code: protected function replaceRequiredForRequiredWith(ValidationRuleDataInterface $rule, array $requiredWithKeys)
      {
          $rules = array_diff($rule->rules(), ['required']);
  
          // If there are no required_with keys to replace it with, leave the rule out
          if (count($requiredWithKeys)) {
  
              $rules[] = 'required_with:' . implode(',', $requiredWithKeys);
          }
  
          $rule->setRules($rules);
      }
code_tokens: protected function replaceRequiredForRequiredWith ( ValidationRuleDataInterface $ rule , array $ requiredWithKeys ) { $ rules = array_diff ( $ rule -> rules ( ) , [ 'required' ] ) ; // If there are no required_with keys to replace it with, leave the rule out if ( count ( $ requiredWithKeys ) ) { $ rules [ ] = 'required_with:' . implode ( ',' , $ requiredWithKeys ) ; } $ rule -> setRules ( $ rules ) ; }
docstring: Updates the rules in a validation data object to replace the required rule with
  a required_with rule for multiple fields.
  
  @param ValidationRuleDataInterface $rule
  @param array                       $requiredWithKeys
docstring_tokens: Updates the rules in a validation data object to replace the required rule with a required_with rule for multiple fields .