protected function getCheckboxCheckedState($name, $value, $checked)
{
if (isset($this->session) && !$this->oldInputIsEmpty() && is_null($this->old($name))) {
return false;
}
if ($this->missingOldAndModel($name)) {
return $checked;
}
$posted = $this->getValueAttribute($name, $checked);
if (is_array($posted)) {
return in_array($value, $posted);
} elseif ($posted instanceof Collection) {
return $posted->contains('id', $value);
} else {
return (bool) $posted;
}
}