private 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);

        if ($posted instanceof Collection)
            return $posted->contains('id', $value);

        return (bool) $posted;
    }
private 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);

        if ($posted instanceof Collection)
            return $posted->contains('id', $value);

        return (bool) $posted;
    }
private 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 ) ; if ( $ posted instanceof Collection ) return $ posted -> contains ( 'id' , $ value ) ; return ( bool ) $ posted ; }
Get the check state for a checkbox input.

@param  string     $name
@param  mixed      $value
@param  bool|null  $checked

@return bool
Get the check state for a checkbox input .