protected function validate_use_validator( array $data, array $rules ) {
		if ( empty( $rules ) ) {
			return;
		}

		$validator = new Validator( $data, $rules );

		$validator->labels(
			$this->fields->pluck( 'name', 'id' )->all()
		);

		if ( $validator->fails() ) {
			foreach ( $rules as $key => $rule ) {
				$this->add_error( $key, $validator->errors( $key ) );
			}
		}
	}
protected function validate_use_validator( array $data, array $rules ) {
		if ( empty( $rules ) ) {
			return;
		}

		$validator = new Validator( $data, $rules );

		$validator->labels(
			$this->fields->pluck( 'name', 'id' )->all()
		);

		if ( $validator->fails() ) {
			foreach ( $rules as $key => $rule ) {
				$this->add_error( $key, $validator->errors( $key ) );
			}
		}
	}
protected function validate_use_validator ( array $ data , array $ rules ) { if ( empty ( $ rules ) ) { return ; } $ validator = new Validator ( $ data , $ rules ) ; $ validator -> labels ( $ this -> fields -> pluck ( 'name' , 'id' ) -> all ( ) ) ; if ( $ validator -> fails ( ) ) { foreach ( $ rules as $ key => $ rule ) { $ this -> add_error ( $ key , $ validator -> errors ( $ key ) ) ; } } }
Validate fields use "validate" parameter.

@param array $data
@param array $rules
Validate fields use validate parameter .