diff --git a/src/NovaBelongsToDepend.php b/src/NovaBelongsToDepend.php index ecceb5c..0b965a9 100644 --- a/src/NovaBelongsToDepend.php +++ b/src/NovaBelongsToDepend.php @@ -97,10 +97,10 @@ public function resolve($resource, $attribute = null) $this->resourceParentClass = get_class(Nova::newResourceFromModel($resource)); $foreign = $resource->{$this->attribute}(); - $this->foreignKeyName = $foreign->getForeignKey(); + $this->foreignKeyName = $foreign->getForeignKeyName(); if ($this->dependsOn) { - $this->dependKey = $resource->{$this->dependsOn}()->getForeignKey(); + $this->dependKey = $resource->{$this->dependsOn}()->getForeignKeyName(); } $value = $resource->{$this->attribute}()->withoutGlobalScopes()->first();