From 60c4b801287fd58c34c802575777673ce783e4e9 Mon Sep 17 00:00:00 2001 From: davide-cattani Date: Mon, 8 Nov 2021 15:05:14 +0100 Subject: [PATCH] fix --- src/NovaBelongsToDepend.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NovaBelongsToDepend.php b/src/NovaBelongsToDepend.php index 7603203..df8e39b 100644 --- a/src/NovaBelongsToDepend.php +++ b/src/NovaBelongsToDepend.php @@ -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();