src/Conductors/SyncsRolesAndAbilities.php
protected function getRelatedPivotKeyName(BelongsToMany $relation)
    {
        if (method_exists($relation, 'getRelatedPivotKeyName')) {
            return $relation->getRelatedPivotKeyName();
        }

        if (method_exists($relation, 'getQualifiedRelatedKeyName')) {
            return $relation->getQualifiedRelatedKeyName();
        }

        return $relation->getOtherKey();
    }
protected function getRelatedPivotKeyName(BelongsToMany $relation)
    {
        if (method_exists($relation, 'getRelatedPivotKeyName')) {
            return $relation->getRelatedPivotKeyName();
        }

        if (method_exists($relation, 'getQualifiedRelatedKeyName')) {
            return $relation->getQualifiedRelatedKeyName();
        }

        return $relation->getOtherKey();
    }
protected function getRelatedPivotKeyName ( BelongsToMany $ relation ) { if ( method_exists ( $ relation , 'getRelatedPivotKeyName' ) ) { return $ relation -> getRelatedPivotKeyName ( ) ; } if ( method_exists ( $ relation , 'getQualifiedRelatedKeyName' ) ) { return $ relation -> getQualifiedRelatedKeyName ( ) ; } return $ relation -> getOtherKey ( ) ; }
Get the column name for the related key on the pivot table.

The name of the underlying method changed in
Laravel 5.4, and then again in 5.5, so we
first check which method is available.

@param  \Illuminate\Database\Eloquent\Relations\BelongsToMany  $relation
@return string
Get the column name for the related key on the pivot table .