src/Engine/Traits/WithValidationTrait.php
public function setValidationRules($attr, $validationRules = null)
    {
        $rules = is_array($attr)
            ? $attr
            : [$attr => $validationRules];

        $this->validationRules = array_merge($this->validationRules, $rules);

        return $this;
    }
public function setValidationRules($attr, $validationRules = null)
    {
        $rules = is_array($attr)
            ? $attr
            : [$attr => $validationRules];

        $this->validationRules = array_merge($this->validationRules, $rules);

        return $this;
    }
public function setValidationRules ( $ attr , $ validationRules = null ) { $ rules = is_array ( $ attr ) ? $ attr : [ $ attr => $ validationRules ] ; $ this -> validationRules = array_merge ( $ this -> validationRules , $ rules ) ; return $ this ; }
Set validation rules array
@param  string|array $attr
@param  string $validationRules = null
@return self
Set validation rules array