/** * @return string */ public function getHtmlMessage() { if (!$this->htmlMessage) { $this->htmlMessage = sprintf("<ul class='validation-msgs'><li>%s</li></ul>", join('</li><li>', $this->bag->all())); } return $this->htmlMessage; }
protected function displayErrors(MessageBag $errors) { foreach ($errors->all() as $error) { $this->error($error); } $this->info('Please try again'); }
/** * Get the string representation of the exception. * * @return string */ public function __toString() { $lines = explode("\n", parent::__toString()); return array_shift($lines) . " \nValidation errors:\n" . implode($this->errors->all(), "\n") . "\n" . implode($lines, "\n"); }
private function getListFromSystemErrorArray(MessageBag $systemErrors = null) { $list = ''; if ($systemErrors) { foreach ($systemErrors->all() as $key => $value) { $list .= '<li>' . $value . '</li>'; } } return $list; }
/** * ValidationJsonApiResponse constructor. * @param MessageBag $errors */ public function __construct(MessageBag $errors) { $this->prepare('errors', $this->normalizeErrors($errors->all())); }