Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
support computed fields
Browse files Browse the repository at this point in the history
  • Loading branch information
milewski committed Oct 28, 2019
1 parent 8f0dbc2 commit f5e4ebd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/InlineMorphTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ public function resolve($resource, $attribute = null)

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

if ($field->computed()) {

$field->computedCallback = $field->computedCallback->bindTo(
Nova::newResourceFromModel($relationInstance)
);

}

$field->resolve($relationInstance);

}
Expand Down

0 comments on commit f5e4ebd

Please sign in to comment.