src/Conductors/Concerns/AssociatesAbilities.php
protected function getAssociatedAbilityIds($authority, array $abilityIds, $forbidden)
    {
        if (is_null($authority)) {
            return $this->getAbilityIdsAssociatedWithEveryone($abilityIds, $forbidden);
        }

        $relation = $authority->abilities();

        $table = Models::table('abilities');

        $relation->whereIn("{$table}.id", $abilityIds)
                 ->wherePivot('forbidden', '=', $forbidden);

        Models::scope()->applyToRelation($relation);

        return $relation->get(["{$table}.id"])->pluck('id')->all();
    }
protected function getAssociatedAbilityIds($authority, array $abilityIds, $forbidden)
    {
        if (is_null($authority)) {
            return $this->getAbilityIdsAssociatedWithEveryone($abilityIds, $forbidden);
        }

        $relation = $authority->abilities();

        $table = Models::table('abilities');

        $relation->whereIn("{$table}.id", $abilityIds)
                 ->wherePivot('forbidden', '=', $forbidden);

        Models::scope()->applyToRelation($relation);

        return $relation->get(["{$table}.id"])->pluck('id')->all();
    }
protected function getAssociatedAbilityIds ( $ authority , array $ abilityIds , $ forbidden ) { if ( is_null ( $ authority ) ) { return $ this -> getAbilityIdsAssociatedWithEveryone ( $ abilityIds , $ forbidden ) ; } $ relation = $ authority -> abilities ( ) ; $ table = Models :: table ( 'abilities' ) ; $ relation -> whereIn ( "{$table}.id" , $ abilityIds ) -> wherePivot ( 'forbidden' , '=' , $ forbidden ) ; Models :: scope ( ) -> applyToRelation ( $ relation ) ; return $ relation -> get ( [ "{$table}.id" ] ) -> pluck ( 'id' ) -> all ( ) ; }
Get the IDs of the associated abilities.

@param  \Illuminate\Database\Eloquent\Model|null  $authority
@param  array  $abilityIds
@param  bool  $forbidden
@return array
Get the IDs of the associated abilities .