/** * @param \Illuminate\Support\MessageBag|\Illuminate\Support\ViewErrorBag $errors * @return $this */ public function errors($errors) { if ($errors instanceof \Illuminate\Support\ViewErrorBag) { $this->errors = $errors->getBag($this->formName); } else { $this->errors = $errors; } return $this; }