Skip to content

Your first collaborative resource ​

Say you have a PostResource with an edit page and a list page.

Install the package and create its tables:

bash
composer require solutionforest/filament-collaboration
php artisan migrate

The migrations are loaded from the package, so there is nothing to publish.

Register the plugin in your panel provider:

php
use SolutionForest\FilamentCollaboration\CollaborationPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(CollaborationPlugin::make());
}

Add a trait to each page. InteractsWithCollaboration is for edit pages: it makes the form live, shows who is here, and merges on save. HasPresence is for every other page: list, create, view or a custom page. It shows who is here.

php
use SolutionForest\FilamentCollaboration\Concerns\InteractsWithCollaboration;

class EditPost extends EditRecord
{
    use InteractsWithCollaboration;
}
php
use SolutionForest\FilamentCollaboration\Concerns\HasPresence;

class ListPosts extends ListRecords
{
    use HasPresence;
}

Try it. Open the same post in two browsers, signed in as two users, and type in the title in both. You see each other's avatars in the header, an outline on the field the other person is in, their caret, and their typing as it happens.

Editing together

Nothing in your form changes. The package reads the form you already have and decides, field by field, how to share it.

Released under the MIT License.