code: public function addConditionalRules($attribute, $rules = [])
      {
          foreach ((array) $attribute as $key) {
              $current = isset($this->conditional[$key]) ? $this->conditional[$key] : [];
              $merge = head($this->validator->explodeRules((array) $rules));
              $this->conditional[$key] = array_merge($current, $merge);
          }
      }
docs: Add conditional rules.
  
  @param mixed $attribute
  @param array $rules
  @return void