public function setError($field, $errors, $overwrite = false)
    {
        if (is_string($errors)) {
            $errors = [$errors];
        }

        return $this->setErrors([$field => $errors], $overwrite);
    }
public function setError($field, $errors, $overwrite = false)
    {
        if (is_string($errors)) {
            $errors = [$errors];
        }

        return $this->setErrors([$field => $errors], $overwrite);
    }
public function setError ( $ field , $ errors , $ overwrite = false ) { if ( is_string ( $ errors ) ) { $ errors = [ $ errors ] ; } return $ this -> setErrors ( [ $ field => $ errors ] , $ overwrite ) ; }
Sets errors for a single field

### Example

```
// Sets the error messages for a single field
$entity->setError('salary', ['must be numeric', 'must be a positive number']);
```

@param string $field The field to get errors for, or the array of errors to set.
@param string|array $errors The errors to be set for $field
@param bool $overwrite Whether or not to overwrite pre-existing errors for $field
@return $this
Sets errors for a single field