src/Conductors/Concerns/DisassociatesAbilities.php
protected function getAbilitiesPivotQuery(Model $model, $ids)
    {
        $relation = $model->abilities();

        list($foreignKeyName, $relatedKeyName) = $this->getRelationKeyNames($relation);

        $query = $relation
            ->newPivotStatement()
            ->where($foreignKeyName, $model->getKey())
            ->where('entity_type', $model->getMorphClass())
            ->whereIn($relatedKeyName, $ids);

        return Models::scope()->applyToRelationQuery(
            $query, $relation->getTable()
        );
    }
protected function getAbilitiesPivotQuery(Model $model, $ids)
    {
        $relation = $model->abilities();

        list($foreignKeyName, $relatedKeyName) = $this->getRelationKeyNames($relation);

        $query = $relation
            ->newPivotStatement()
            ->where($foreignKeyName, $model->getKey())
            ->where('entity_type', $model->getMorphClass())
            ->whereIn($relatedKeyName, $ids);

        return Models::scope()->applyToRelationQuery(
            $query, $relation->getTable()
        );
    }
protected function getAbilitiesPivotQuery ( Model $ model , $ ids ) { $ relation = $ model -> abilities ( ) ; list ( $ foreignKeyName , $ relatedKeyName ) = $ this -> getRelationKeyNames ( $ relation ) ; $ query = $ relation -> newPivotStatement ( ) -> where ( $ foreignKeyName , $ model -> getKey ( ) ) -> where ( 'entity_type' , $ model -> getMorphClass ( ) ) -> whereIn ( $ relatedKeyName , $ ids ) ; return Models :: scope ( ) -> applyToRelationQuery ( $ query , $ relation -> getTable ( ) ) ; }
Get the base abilities pivot query.

@param  \Illuminate\Database\Eloquent\Model  $model
@param  array  $ids
@return \Illuminate\Database\Query\Builder
Get the base abilities pivot query .