code: protected function getCheckboxCheckedState($name, $value, $checked)
      {
          $posted = $this->getValueAttribute($name, $checked);
  
          if (is_array($posted)) {
              return in_array($value, $posted);
          } else {
              return (bool)$posted;
          }
      }
docs: Get the check state for a checkbox input.
  
  @param  string $name
  @param  mixed  $value
  @param  bool   $checked
  
  @return bool