Saving, drafts and conflicts
All live fields of a record share one draft, kept in the database. It survives everybody leaving and coming back.
- Save validates and publishes the draft as it is at that moment, including what colleagues typed. Fields that are not live are merged with what is stored.
- The header shows Unsaved changes while the draft differs from the record. Anyone who can edit can discard the draft from the people panel.
- A change made outside the form, such as a modal, an import or a queued job, is merged into what people are typing.
- A save from a browser that is not live (offline too long, or with live editing off) wins in the fields it changed.
When a field that is not live was changed by two people, Save shows a conflict dialog: for each field, keep yours or take theirs.

When a record is deleted
Everybody still on it is told at once, by name: "Bob deleted this record". Their form stays on screen, read-only, with Copy my text, so nothing typed is lost.
- With soft deletes, the shared draft is kept, and people the policy allows to
restoreget a Restore button that brings the record back with the draft. - When a record is gone for good (no soft deletes, or force-deleted), its draft, edit history and unsaved images are deleted with it.
- Someone who could no longer reach the record anyway, say after moving to another team, is only told they no longer have access.
This works for deletions anywhere in your app that go through Eloquent, not only Filament's delete action. Query-builder deletes (Post::where(...)->delete()) fire no model events: call app(DeletedRecords::class)->deleted($post) for those, if people may be editing them.
React to saves and merges with Laravel events, all in SolutionForest\FilamentCollaboration\Events:
| Event | When | Has |
|---|---|---|
SharedDraftSaved | a save published the shared draft | record, user, fields, contributors |
ChangesMerged | a save took someone else's changes in fields this user did not touch | record, user, fields, theirName |
ConflictDetected | a save stopped to ask which value to keep | record, user, fields, theirName |
ConflictResolved | the user chose in the conflict dialog | record, user, choices |
DraftEdited | with audit() on, someone changed a field, once per minute | record, by, field, minute |
Auditing who changed what
A save publishes what colleagues typed too, so an audit that only records who pressed Save credits them with everybody's work. SharedDraftSaved says who changed each field since it was last saved:
use SolutionForest\FilamentCollaboration\Events\SharedDraftSaved;
Event::listen(function (SharedDraftSaved $event): void {
$event->user; // who pressed Save
$event->contributorNames(); // ['title' => ['Alice Chen', 'Bob Martinez'], 'excerpt' => ['Bob Martinez']]
$event->contributors(); // each person once, as Contributor: type, id, name, at, user()
});With spatie/laravel-activitylog:
Event::listen(function (SharedDraftSaved $event): void {
activity()
->performedOn($event->record)
->causedBy($event->user)
->withProperties(['contributors' => $event->contributorNames()])
->log('saved the shared draft');
});With owen-it/laravel-auditing, add the names to the audit the save creates, in the model's transformAudit(), or record a custom audit from the same listener.
An edit trail, saved or not
Turn on audit() to also keep a trail of every change to the draft, including drafts that are discarded and never saved. It is one row per person, field and minute, not one per keystroke, in filament_collaboration_edits:
CollaborationPlugin::make()->audit();use SolutionForest\FilamentCollaboration\Documents\EditTrail;
app(EditTrail::class)->for($post);
// [['user_name' => 'Alice Chen', 'user_type' => User::class, 'user_id' => '7', 'field' => 'title', 'at' => CarbonImmutable], ...]Each new row also dispatches DraftEdited (record, by, field, minute), to send wherever you like. The trail is kept until you delete it, for example with a scheduled DB::table('filament_collaboration_edits')->where('minute', '<', now()->subYear()->getTimestamp())->delete().
Comments and version history
Add CollaborationPanelAction to the page's header actions: an icon button, with "Comments & history" as its tooltip and accessible name, and the number of open comments as a badge. It opens one slide-over with two tabs, Comments and History. Its History tab lists the shared draft's versions, newest first, with who changed it and which fields:
use SolutionForest\FilamentCollaboration\Actions\CollaborationPanelAction;
protected function getHeaderActions(): array
{
return [
CollaborationPanelAction::make(),
];
}Optional. Turn it off for the whole panel, or decide per resource or per record. Off, the button is not rendered, and the page refuses to post, resolve or restore, even if asked directly. Versions are still kept, so turning it back on shows the history:
CollaborationPlugin::make()->commentsAndHistory(false);
CollaborationPlugin::make()->commentsAndHistory(fn (Model $record): bool => ! $record instanceof Invoice);A version is kept at most every five minutes while people edit, on every save, before a discard, and before and after a restore, up to the last 100 per draft, in filament_collaboration_versions. Restore, on any version including the newest (colleagues may have changed the draft since), puts the draft back as it was, for everybody in the room at once; the draft from before the restore stays in the list, so a restore can be undone. It changes only the live fields the person may edit, and nothing is saved until somebody saves. On a translated page each language has its own history.

Comments are on the record, or on one of its fields. Everybody who can open the record reads them and can comment. The author and anybody who may edit the record can resolve or reopen a comment. The button shows how many comments are open. Every language of a translated record shares its comments, and deleting a record for good deletes them too.
To let people @mention each other, say who may be mentioned on a record. The comment box suggests their names after @. Each person mentioned gets a Filament database notification that links back to the record:
CollaborationPlugin::make()
->mentionable(fn (Model $record) => User::query()->where('team_id', $record->team_id));
$panel->databaseNotifications(); // to show them in the panelPass notify: false to skip the notifications. CommentPosted (record, by, comment, url) is dispatched for every comment, and $event->comment->mentions lists the people it mentions, so you can send the news anywhere else too.
