A user can specify a different secondLocalKey.
The current implementation is always looking for the getQualifiedKeyName of the parent which assumes is the value returned by getKeyName
protected function getJoinKeys(Relation $relation)
{
...
if ($relation instanceof HasManyThrough) {
$fk = $relation->getQualifiedFarKeyName();
return [$fk, $relation->getParent()->getQualifiedKeyName()];
}
}
In this new version, it's going to look at the $relation->getQualifiedParentKeyName() which is retrieved based on the value that was set for secondLocalKey when the relation was defined.
A user can specify a different
secondLocalKey
. The current implementation is always looking for thegetQualifiedKeyName
of the parent which assumes is the value returned bygetKeyName
In this new version, it's going to look at the
$relation->getQualifiedParentKeyName()
which is retrieved based on the value that was set forsecondLocalKey
when the relation was defined.