Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Sep 9, 2024
1 parent 0eaa1e0 commit 651e957
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Relations/BelongsToThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ public function getFirstForeignKeyName()
*/
public function getQualifiedFirstLocalKeyName()
{
$lastThroughParent = end($this->throughParents);
$firstThroughParent = end($this->throughParents);

if ($lastThroughParent === false) {
if ($firstThroughParent === false) {
throw new RuntimeException('No "through" parent models were specified.');
}

return $lastThroughParent->qualifyColumn($this->getLocalKeyName($lastThroughParent));
return $firstThroughParent->qualifyColumn($this->getLocalKeyName($firstThroughParent));
}

/**
Expand Down

0 comments on commit 651e957

Please sign in to comment.