class; if (session()->has('errors')) { $error = session('errors')[$this->name]; if ($error) { $class .= ' border-red'; } } else { $class .= ' border-black focus:border-black'; } $this->attributes['class'] = $class; if ($this->required) { $this->attributes['required'] = 'required'; } return form_input($this->attributes, old($this->name, $this->value)); } }