protected function getErrors()
    {
        $errors = [];

        $generalErrors = [];
        foreach ($this->form->getErrors() as $error) {
            $generalErrors[] = $error->getMessage();
        }

        if (!empty($generalErrors)) {
            $errors['general'] = $generalErrors;
        }

        foreach ($this->form->all() as $field) {
            $fieldErrors = [];

            foreach ($field->getErrors() as $error) {
                $fieldErrors[] = $error->getMessage();
            }

            if (!empty($fieldErrors)) {
                $errors[$field->getName()] = $fieldErrors;
            }
        }

        return $errors;
    }
protected function getErrors()
    {
        $errors = [];

        $generalErrors = [];
        foreach ($this->form->getErrors() as $error) {
            $generalErrors[] = $error->getMessage();
        }

        if (!empty($generalErrors)) {
            $errors['general'] = $generalErrors;
        }

        foreach ($this->form->all() as $field) {
            $fieldErrors = [];

            foreach ($field->getErrors() as $error) {
                $fieldErrors[] = $error->getMessage();
            }

            if (!empty($fieldErrors)) {
                $errors[$field->getName()] = $fieldErrors;
            }
        }

        return $errors;
    }
protected function getErrors ( ) { $ errors = [ ] ; $ generalErrors = [ ] ; foreach ( $ this -> form -> getErrors ( ) as $ error ) { $ generalErrors [ ] = $ error -> getMessage ( ) ; } if ( ! empty ( $ generalErrors ) ) { $ errors [ 'general' ] = $ generalErrors ; } foreach ( $ this -> form -> all ( ) as $ field ) { $ fieldErrors = [ ] ; foreach ( $ field -> getErrors ( ) as $ error ) { $ fieldErrors [ ] = $ error -> getMessage ( ) ; } if ( ! empty ( $ fieldErrors ) ) { $ errors [ $ field -> getName ( ) ] = $ fieldErrors ; } } return $ errors ; }
Get errors.

@return array
Get errors .