src/Mappable.php
protected function getJoinKeys(Relation $relation)
    {
        if ($relation instanceof HasOne || $relation instanceof MorphOne) {
            return [$relation->getQualifiedForeignKeyName(), $relation->getQualifiedParentKeyName()];
        }

        if ($relation instanceof BelongsTo && !$relation instanceof MorphTo) {
            return [$relation->getQualifiedForeignKey(), $relation->getQualifiedOwnerKeyName()];
        }

        $class = get_class($relation);

        throw new LogicException(
            "Only HasOne, MorphOne and BelongsTo mappings can be queried. {$class} given."
        );
    }
protected function getJoinKeys(Relation $relation)
    {
        if ($relation instanceof HasOne || $relation instanceof MorphOne) {
            return [$relation->getQualifiedForeignKeyName(), $relation->getQualifiedParentKeyName()];
        }

        if ($relation instanceof BelongsTo && !$relation instanceof MorphTo) {
            return [$relation->getQualifiedForeignKey(), $relation->getQualifiedOwnerKeyName()];
        }

        $class = get_class($relation);

        throw new LogicException(
            "Only HasOne, MorphOne and BelongsTo mappings can be queried. {$class} given."
        );
    }
protected function getJoinKeys ( Relation $ relation ) { if ( $ relation instanceof HasOne || $ relation instanceof MorphOne ) { return [ $ relation -> getQualifiedForeignKeyName ( ) , $ relation -> getQualifiedParentKeyName ( ) ] ; } if ( $ relation instanceof BelongsTo && ! $ relation instanceof MorphTo ) { return [ $ relation -> getQualifiedForeignKey ( ) , $ relation -> getQualifiedOwnerKeyName ( ) ] ; } $ class = get_class ( $ relation ) ; throw new LogicException ( "Only HasOne, MorphOne and BelongsTo mappings can be queried. {$class} given." ) ; }
Get the keys from relation in order to join the table.

@param  \Illuminate\Database\Eloquent\Relations\Relation $relation
@return array

@throws \LogicException
Get the keys from relation in order to join the table .