Overtrue\Validation\Validator::mergeRules PHP Method

mergeRules() public method

Merge additional rules into a given attribute.
public mergeRules ( string $attribute, string | array $rules )
$attribute string
$rules string | array
    public function mergeRules($attribute, $rules)
    {
        $current = isset($this->rules[$attribute]) ? $this->rules[$attribute] : [];
        $merge = head($this->explodeRules([$rules]));
        $this->rules[$attribute] = array_merge($current, $merge);
    }
Validator