src/Conductors/SyncsRolesAndAbilities.php
protected function newPivotQuery(BelongsToMany $relation)
    {
        $query = $relation->newPivotStatement()->where(
            $this->getForeignPivotKeyName($relation),
            $relation->getParent()->getKey()
        );

        return Models::scope()->applyToRelationQuery(
            $query, $relation->getTable()
        );
    }
protected function newPivotQuery(BelongsToMany $relation)
    {
        $query = $relation->newPivotStatement()->where(
            $this->getForeignPivotKeyName($relation),
            $relation->getParent()->getKey()
        );

        return Models::scope()->applyToRelationQuery(
            $query, $relation->getTable()
        );
    }
protected function newPivotQuery ( BelongsToMany $ relation ) { $ query = $ relation -> newPivotStatement ( ) -> where ( $ this -> getForeignPivotKeyName ( $ relation ) , $ relation -> getParent ( ) -> getKey ( ) ) ; return Models :: scope ( ) -> applyToRelationQuery ( $ query , $ relation -> getTable ( ) ) ; }
Get a scoped query for the pivot table.

@param  \Illuminate\Database\Eloquent\Relations\BelongsToMany  $relation
@return \Illuminate\Database\Query\Builder
Get a scoped query for the pivot table .