public function addError(string $key, string $message, string $group = null): self
    {
        if (!empty($group)) {
            $this->errors[$group][$key][] = $message;
        } else {
            $this->errors[$key][] = $message;
        }

        return $this;
    }
public function addError(string $key, string $message, string $group = null): self
    {
        if (!empty($group)) {
            $this->errors[$group][$key][] = $message;
        } else {
            $this->errors[$key][] = $message;
        }

        return $this;
    }
public function addError ( string $ key , string $ message , string $ group = null ) : self { if ( ! empty ( $ group ) ) { $ this -> errors [ $ group ] [ $ key ] [ ] = $ message ; } else { $ this -> errors [ $ key ] [ ] = $ message ; } return $ this ; }
Adds a validation error.

@param string      $key
@param string      $message
@param string|null $group

@return self
Adds a validation error .