src/Validation.php
public function getFieldErrors(string $field): array {
        if (empty($this->errors[$field])) {
            return [];
        } else {
            $result = [];
            foreach ($this->errors[$field] as $error) {
                $result[] = $this->pluckError($error + ['field' => $field]);
            }
            return $result;
        }
    }
public function getFieldErrors(string $field): array {
        if (empty($this->errors[$field])) {
            return [];
        } else {
            $result = [];
            foreach ($this->errors[$field] as $error) {
                $result[] = $this->pluckError($error + ['field' => $field]);
            }
            return $result;
        }
    }
public function getFieldErrors ( string $ field ) : array { if ( empty ( $ this -> errors [ $ field ] ) ) { return [ ] ; } else { $ result = [ ] ; foreach ( $ this -> errors [ $ field ] as $ error ) { $ result [ ] = $ this -> pluckError ( $ error + [ 'field' => $ field ] ) ; } return $ result ; } }
Get the errors for a specific field.

@param string $field The full path to the field.
@return array Returns an array of errors.
Get the errors for a specific field .