public function getErrors(): array
    {
        $errors = $this->validate()->getErrors();
        foreach ($errors as &$error) {
            if (is_string($error) && Translator::isMessage($error)) {
                // translate error message
                $error = $this->say($error);
            }

            unset($error);
        }

        return $errors;
    }
public function getErrors(): array
    {
        $errors = $this->validate()->getErrors();
        foreach ($errors as &$error) {
            if (is_string($error) && Translator::isMessage($error)) {
                // translate error message
                $error = $this->say($error);
            }

            unset($error);
        }

        return $errors;
    }
public function getErrors ( ) : array { $ errors = $ this -> validate ( ) -> getErrors ( ) ; foreach ( $ errors as & $ error ) { if ( is_string ( $ error ) && Translator :: isMessage ( $ error ) ) { // translate error message $ error = $ this -> say ( $ error ) ; } unset ( $ error ) ; } return $ errors ; }
Get all validation messages.

@return array
Get all validation messages .