Skip to content

Commit 7c27295

Browse files
authored
Adds ability to call getValue if returned value object has method.
1 parent e973d99 commit 7c27295

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/AttributeManager.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,15 @@ public function getFieldValue(View $view)
143143
}
144144

145145
$value = old($fieldName, $value);
146+
147+
if (is_object($value) && method_exists($value, 'getValue')) {
148+
$value = $value->getValue();
149+
}
146150

147151
if ($value instanceof Collection) {
148152
$value = $value->modelKeys();
149153
}
150154

151155
return is_bool($value) ? intval($value) : $value;
152156
}
153-
}
157+
}

0 commit comments

Comments
 (0)