From 2e8d9de156325c2f121b198cec4a25594121f087 Mon Sep 17 00:00:00 2001 From: Igor Prieto Echepare Date: Wed, 6 Mar 2019 15:29:17 +0100 Subject: [PATCH] Change the method for the new Laravel specs --- src/NovaBelongsToDepend.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();