Siren

CollaboratorRemovedFromCollaboratorGroup

Fires when a collaborator is removed from a collaborator group.

Last updated: June 3, 2026

CollaboratorRemovedFromCollaboratorGroup fires when a collaborator stops being a member of a collaborator group. One event fires per removed member, whether the removal came through the single-member endpoint or as part of a bulk member replacement.

The event ID is collaborator_removed_from_collaborator_group, and its fully qualified class is Siren\Plus\Core\Groups\Events\CollaboratorRemovedFromCollaboratorGroup. It fires after the membership row is deleted, through either the single-member remove endpoint or a bulk member replacement. To run code when it fires, register a handler with Siren’s event system. See listeners and the events introduction.

What does this event carry?

The event carries the group id and the collaborator id. The previous metadata is not included. By the time a listener runs, the membership row is gone and only the identity pair remains. If your cleanup needs the removed member’s former position or parentCollaboratorId, capture it on an earlier added or metadata-changed event and store it yourself, because it is unrecoverable here.

use PHPNomad\Events\Interfaces\CanHandle;
use PHPNomad\Events\Interfaces\Event;
use Siren\Plus\Core\Groups\Events\CollaboratorRemovedFromCollaboratorGroup;

class HandleRemovedMember implements CanHandle
{
    public function handle(Event $event): void
    {
        if (!$event instanceof CollaboratorRemovedFromCollaboratorGroup) {
            return;
        }

        $groupId = $event->getGroupId();
        $collaboratorId = $event->getCollaboratorId();

        // The collaborator is no longer reachable through this group's cascade
    }
}

How does it fit?

A removal changes the shape of the group for the next cascade. In a linear chain the remaining members keep their stored positions, so the numbers are no longer contiguous, but that gap is harmless. Layers are counted by rank order, not by the position value, so the remaining members close ranks and the chain cascades normally. Re-sequencing positions is cosmetic, not required.

In a parent-child tree, removing a parent leaves its children with a parent reference that now points outside the group, so each of those children becomes a root. Their own subtrees stay intact but are detached from everything above the removed parent, which quietly cuts that branch out of any cascade running through it. Only the removed member fires an event. The children’s rows are not rewritten (their re-rooting happens when the structure is next resolved), so no event fires for them. A listener or mirror that tracks the tree must re-evaluate the removed member’s children itself.

The activity feed records each removal. Cleanup listeners use the event to tear down any per-member state they were keeping. A single bulk member replacement (a PUT of the full member list) fans out into one removed event per dropped member, plus added events for new members and metadata-changed events for members whose metadata changed.

CollaboratorAddedToCollaboratorGroup and CollaboratorGroupMemberMetadataChanged are the other membership events, and CollaboratorGroupDeleted removes every member at once without firing per-member removed events. The collaborator group events reference lists the full family.