File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -618,7 +618,7 @@ protected function getCheckboxCheckedState($name, $checked)
618618 {
619619 if ( ! $ this ->oldInputIsEmpty () and is_null ($ this ->old ($ name ))) return false ;
620620
621- if (is_null ( $ this ->old ($ name) )) return $ checked ;
621+ if ($ this ->missingOldAndModel ($ name )) return $ checked ;
622622
623623 return (bool ) $ this ->getValueAttribute ($ name );
624624 }
@@ -633,11 +633,22 @@ protected function getCheckboxCheckedState($name, $checked)
633633 */
634634 protected function getRadioCheckedState ($ name , $ value , $ checked )
635635 {
636- if (is_null ( $ this ->old ($ name) )) return $ checked ;
636+ if ($ this ->missingOldAndModel ($ name )) return $ checked ;
637637
638638 return $ this ->getValueAttribute ($ name ) == $ value ;
639639 }
640640
641+ /**
642+ * Determine if old input or model input exists for a key.
643+ *
644+ * @param string $name
645+ * @return bool
646+ */
647+ protected function missingOldAndModel ($ name )
648+ {
649+ return (is_null ($ this ->old ($ name )) and is_null ($ this ->getModelValueAttribute ($ name )));
650+ }
651+
641652 /**
642653 * Create a HTML reset input element.
643654 *
You can’t perform that action at this time.
0 commit comments