src/Conductors/AssignsRoles.php
protected function getExistingAttachRecords($roleIds, $morphType, $authorityIds)
    {
        $query = $this->newPivotTableQuery()
            ->whereIn('role_id', $roleIds->all())
            ->whereIn('entity_id', $authorityIds->all())
            ->where('entity_type', $morphType);

        Models::scope()->applyToRelationQuery($query, $query->from);

        return new Collection($query->get());
    }
protected function getExistingAttachRecords($roleIds, $morphType, $authorityIds)
    {
        $query = $this->newPivotTableQuery()
            ->whereIn('role_id', $roleIds->all())
            ->whereIn('entity_id', $authorityIds->all())
            ->where('entity_type', $morphType);

        Models::scope()->applyToRelationQuery($query, $query->from);

        return new Collection($query->get());
    }
protected function getExistingAttachRecords ( $ roleIds , $ morphType , $ authorityIds ) { $ query = $ this -> newPivotTableQuery ( ) -> whereIn ( 'role_id' , $ roleIds -> all ( ) ) -> whereIn ( 'entity_id' , $ authorityIds -> all ( ) ) -> where ( 'entity_type' , $ morphType ) ; Models :: scope ( ) -> applyToRelationQuery ( $ query , $ query -> from ) ; return new Collection ( $ query -> get ( ) ) ; }
Get the pivot table records for the roles already assigned.

@param  \Illuminate\Suuport\Collection  $roleIds
@param  string $morphType
@param  \Illuminate\Suuport\Collection  $authorityIds
@return \Illuminate\Support\Collection
Get the pivot table records for the roles already assigned .