Get the errors for a given field

@param string $field A dot separated path to check errors on.
@return array An array of errors.
512597
public function error($field)
    {
        $parts = explode('.', $field);
        $entity = $this->entity($parts);

        if ($entity instanceof EntityInterface) {
            return $entity->getError(array_pop($parts));
        }

        return [];
    }
6350
public function rules($field)
    {
        return (isset($this->data[$field]) && $validate = $this->data[$field]['validate']) ? $validate : array();
    }
957144
public function getMessage($field)
    {
        $identifier = ($field instanceof FieldInterface) ? $field->getFieldElementName() : $field;
        foreach ($this->getList() as $error) {
            $field = $error->getField();
            if (is_object($field) && $field->getFieldElementName() == $identifier) {
                return $error->getMessage();
            }
        }

        return false;
    }
839551
private function formatErrorList(string $field, array $errors) {
        if (empty($field)) {
            $fieldName = '';
            $colon = '%s%s';
            $sep = "\n";
        } else {
            $fieldName = $this->formatFieldName($field);
            $colon = $this->translate('%s: %s');
            $sep = "\n  ";
            if (count($errors) > 1) {
                $colon = rtrim(sprintf($colon, '%s', "")).$sep.'%s';
            }
        }

        $messages = $this->errorMessages($field, $errors);
        $result = sprintf($colon, $fieldName, implode($sep, $messages));
        return $result;
    }
713107
public function getError($field) {
        if(array_key_exists($field, $this->errors)) {
            return $this->errors[$field];
        }
        return null;
    }
167516
public function getErrorMessages()
    {
        $errors = [];
        foreach ($this->fields as $field) {
            if ($field instanceof AbstractFormField && !$field->isValid()) {
                $fldErrors = $field->getErrorMessages();
                $errors = array_merge($errors, $fldErrors);
            }
        }

        return $errors;
    }
1333928
public function getErrorCount($field = null) {
        if ($field === null) {
            return iterator_count($this->getRawErrors());
        } elseif (empty($this->errors[$field])) {
            return 0;
        } else {
            return count($this->errors[$field]);
        }
    }
1141105
protected static function getValidationConfigByField($field)
    {
        $data = config('laravel-sms.validation', []);
        if (isset($data[$field])) {
            return $data[$field];
        }
        throw new LaravelSmsException("Not find the configuration information of field `$field`, please define it.");
    }
46846
protected function get_field($field) {
        $fieldname = calculator::using_attempts_string_id($this->whichattempts).$field;
        return $this->{$fieldname};
    }
1262743
public function getValue($field)
  {
    $v = $this->getValues();

    return isset($v[$field]) ? $v[$field] : false;
  }
830316
public function values($field)
    {
        $values = [];
        foreach ($this->queries as $query) {
            $t = $query->values($field);
            /** @noinspection SlowArrayOperationsInLoopInspection */
            $values = array_merge($values, $t);
        }

        return array_values(array_unique($values, SORT_REGULAR));
    }
60386
private function errorMessages(string $field, array $errors): array {
        $messages = [];

        foreach ($errors as $error) {
            $messages[] = $this->formatErrorMessage($error + ['field' => $field]);
        }
        return $messages;
    }
876766
public function isValidField(string $field): bool {
        $result = empty($this->errors[$field]);
        return $result;
    }
1316387
public function error($field = null, $default = false)
	{
		if ($field === null)
		{
			return $this->errors;
		}

		return array_key_exists($field, $this->errors) ? $this->errors[$field] : $default;
	}
1235419
public function hasError($field)
    {
        if (empty($this->_context['errors'])) {
            return false;
        }

        return (bool)Hash::check($this->_context['errors'], $field);
    }
190359
protected function get_roleids_for(string $field) {
        $value = $this->raw_get($field);
        if (empty($value)) {
            return [];
        }

        return json_decode($value);
    }
1266819
protected function getField($field)
    {
        foreach ($this->getFields() as $annotatedField) {
            if ($annotatedField->name === $field) {
                return $annotatedField;
            }
        }

        return null;
    }