Skip to content

Commit

Permalink
Merge pull request #34 from Iprieto/HEAD
Browse files Browse the repository at this point in the history
Change the method for the new Laravel specs
  • Loading branch information
orlyapps authored Mar 11, 2019
2 parents 8174572 + 2e8d9de commit 8082308
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NovaBelongsToDepend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8082308

Please sign in to comment.