src/Conductors/AssignsRoles.php
protected function buildAttachRecords($roleIds, $morphType, $authorityIds)
    {
        return $roleIds->map(function ($roleId) use ($morphType, $authorityIds) {
            return $authorityIds->map(function ($authorityId) use ($roleId, $morphType) {
                return Models::scope()->getAttachAttributes() + [
                    'role_id' => $roleId,
                    'entity_id' => $authorityId,
                    'entity_type' => $morphType,
                ];
            });
        })->collapse();
    }
protected function buildAttachRecords($roleIds, $morphType, $authorityIds)
    {
        return $roleIds->map(function ($roleId) use ($morphType, $authorityIds) {
            return $authorityIds->map(function ($authorityId) use ($roleId, $morphType) {
                return Models::scope()->getAttachAttributes() + [
                    'role_id' => $roleId,
                    'entity_id' => $authorityId,
                    'entity_type' => $morphType,
                ];
            });
        })->collapse();
    }
protected function buildAttachRecords ( $ roleIds , $ morphType , $ authorityIds ) { return $ roleIds -> map ( function ( $ roleId ) use ( $ morphType , $ authorityIds ) { return $ authorityIds -> map ( function ( $ authorityId ) use ( $ roleId , $ morphType ) { return Models :: scope ( ) -> getAttachAttributes ( ) + [ 'role_id' => $ roleId , 'entity_id' => $ authorityId , 'entity_type' => $ morphType , ] ; } ) ; } ) -> collapse ( ) ; }
Build the raw attach records for the assigned roles pivot table.

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