public static function validationErrorsToString($messages)
    {
        if ($messages instanceof MessageBag) {
            $messages = $messages->getMessages();
        }

        $errorString = '';

        if (is_array($messages)) {
            foreach ($messages as $field => $errors) {
                foreach ($errors as $error) {
                    $errorString .= ' ' . $error;
                }
            }
        }

        return $errorString;
    }