Skip to content

Commit 7373e20

Browse files
committed
Improve comment
1 parent 4bb1915 commit 7373e20

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/Models/ReportTemplate.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ public function checkmarkValue(string $fieldName, string $fallbackValue = '1'):
109109
return $fallbackValue;
110110
}
111111

112-
// Return the field's value if it exists and return 0
113-
// if not so that checkboxes are unchecked by default.
112+
// If the model does exist then return the value of the field
113+
// or return 0 so the checkbox is unchecked.
114+
// Falling back to 0 here is because checkboxes are not sent
115+
// in the request when unchecked so they are not
116+
// actually saved in the model's options.
114117
return $this->options[$fieldName] ?? '0';
115118
}
116119

0 commit comments

Comments
 (0)