Skip to content

Commit f5e4ebd

Browse files
committed
support computed fields
1 parent 8f0dbc2 commit f5e4ebd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/InlineMorphTo.php

+8
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ public function resolve($resource, $attribute = null)
168168

169169
foreach ($this->getFields($relationInstance) as $field) {
170170

171+
if ($field->computed()) {
172+
173+
$field->computedCallback = $field->computedCallback->bindTo(
174+
Nova::newResourceFromModel($relationInstance)
175+
);
176+
177+
}
178+
171179
$field->resolve($relationInstance);
172180

173181
}

0 commit comments

Comments
 (0)