예제 #1
0
 /**
  * @param bool $required
  *
  * @return $this|self
  */
 public function setRequired(bool $required = true)
 {
     if ($required) {
         $this->field->addAttribute('required', 'required');
     } else {
         $this->field->removeAttribute('required');
     }
     return $this;
 }