Skip to content

Commit 50d201e

Browse files
author
Liran Cohen
committed
Add a friendly value attribute.
1 parent ccdef25 commit 50d201e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Models/CustomFieldResponse.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ public function getValueAttribute()
6262
);
6363
}
6464

65+
public function getValueFriendlyAttribute()
66+
{
67+
if ($this->field->type === 'checkbox') {
68+
return $this->value ? 'Checked' : 'Unchecked';
69+
}
70+
71+
return $this->value;
72+
}
73+
6574
public function formatValue($value)
6675
{
6776
// checkboxes send a default value of `on` so we need to booleanize it.

0 commit comments

Comments
 (0)