Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-cattani committed Nov 8, 2021
1 parent 7568352 commit 60c4b80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/NovaBelongsToDepend.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ public function resolve($resource, $attribute = null)
}

parent::resolve($resource, $attribute);
$this->resourceParentClass = get_class(Nova::newResourceFromModel($resource));
if (!$this->resourceParentClass) {
$this->resourceParentClass = get_class(Nova::newResourceFromModel($resource));
}

$foreign = $resource->{$this->attribute}();
$this->foreignKeyName = $foreign->getForeignKeyName();
Expand Down

0 comments on commit 60c4b80

Please sign in to comment.