From 7373e2019cb8dba9cf05fd1e69eddc26abd57b41 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 12 Nov 2024 10:01:32 -0800 Subject: [PATCH] Improve comment --- app/Models/ReportTemplate.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Models/ReportTemplate.php b/app/Models/ReportTemplate.php index 0770eafc49..06f0370a00 100644 --- a/app/Models/ReportTemplate.php +++ b/app/Models/ReportTemplate.php @@ -109,8 +109,11 @@ class ReportTemplate extends Model return $fallbackValue; } - // Return the field's value if it exists and return 0 - // if not so that checkboxes are unchecked by default. + // If the model does exist then return the value of the field + // or return 0 so the checkbox is unchecked. + // Falling back to 0 here is because checkboxes are not sent + // in the request when unchecked so they are not + // actually saved in the model's options. return $this->options[$fieldName] ?? '0'; }