Esempio n. 1
0
 /**
  * Reads the first Message from ViewErrorBag if existent
  * @param  ViewErrorBag $errors
  * @param  string     $key
  * @return bool|string
  */
 private function getFirstErrorMessage(ViewErrorBag $errors, $key)
 {
     if ($errors->has($key)) {
         return $errors->first($key);
     }
     return false;
 }
 /**
  * @param string $name
  * @param string $locale
  *
  * @return string
  */
 public function error($name, $locale = null)
 {
     return $this->html()->error($this->errors->first($name));
 }
Esempio n. 3
0
 /**
  * Append error label to element and wrap it with div
  *
  * @param string $name
  * @param string $content
  * @return string
  */
 protected function wrapContent($name, $content)
 {
     $content .= $this->errors->first($name, $this->getErrorTemplate());
     $class = $this->getErrorClass($name);
     return $this->wrapGroup($content, compact('class'));
 }
 public function error(string $name) : string
 {
     return Html::error($this->errors->first($name));
 }