Skip to content

Presence in tables and modals ​

Fields out of sight. When somebody is in a field behind a tab that is not selected, a wizard step that is not current, or a collapsed section, their initials show on that tab, step or section header. Choosing them in the avatar list opens the tab and the section and scrolls to the field. There is nothing to set up.

Bob is behind the closed Publishing tab

Following a colleague. In the avatar list, Follow next to somebody keeps going to whichever field they are in, opening tabs and sections on the way, so you can watch a walkthrough without chasing it. Clicking or typing anywhere in the form stops it, and so does Stop following or them leaving.

Following Bob opened the tab and the section

Relation managers. Add SharesRelationChanges to a relation manager, and what one person creates, edits, deletes, attaches or toggles in it shows at once in everybody else's copy of the page, over Reverb or at their next poll:

php
use SolutionForest\FilamentCollaboration\Concerns\SharesRelationChanges;

class TasksRelationManager extends RelationManager
{
    use SharesRelationChanges;
}
Tasks Alice added, in Bob's open copy

A column with the people on each record:

php
use SolutionForest\FilamentCollaboration\Tables\PresenceColumn;

public static function table(Table $table): Table
{
    return $table
        ->poll('3s')
        ->columns([
            // ...
            PresenceColumn::make(),
        ]);
}

The list page needs the HasPresence trait.

People on each record

An edit modal with presence and merge on save:

php
->recordActions([
    EditAction::make()->collaborate(),
])

Call collaborate() last: it wraps the action's lifecycle hooks. Fields in modals merge on save; they are not live.

Editing in a modal

Released under the MIT License.