Skip to content

Install and quick start ​

Requirements ​

Supported
PHP8.3, 8.4
Laravel12, 13
Livewire4
Inertia3, with React 19 or Vue 3.5
Rich textTipTap 3
DatabaseMySQL / MariaDB, PostgreSQL, SQLite
CacheAny store with atomic locks, shared by every app server: Redis, database, or file on a single server
OptionalLaravel Reverb or any Pusher-compatible broadcaster, for pushed changes. Redis, for presence across many servers.

Installation ​

Install it, and let the installer set it up:

bash
composer require solutionforest/laravel-collaboration
php artisan collaboration:install

The installer publishes the config, creates the tables, installs the browser side for an Inertia app, and prints the next steps for your stack.

Nothing else: the package serves its own script, and <x-collaboration::room> adds it to the page.

Say which fields people edit together ​

php
use SolutionForest\Collaboration\Concerns\Collaborative;
use SolutionForest\Collaboration\Enums\FieldKind;

class Post extends Model
{
    use Collaborative;

    protected array $collaborative = [
        'title',                            // text, merged by character
        'summary',
        'body' => FieldKind::RichText,      // TipTap, kept as HTML or JSON, like the column
        'status' => FieldKind::Value,       // select, radio: the latest choice wins
        'published_at',                     // cast to a date, so a value
        'channels',                         // cast to an array: a checkbox group
    ];
}

A name alone takes its kind from the model's casts: booleans, numbers, dates and enums are values, everything else is text. Kinds may also be written as strings ('rich', 'value'), but FieldKind cases can't be misspelt.

People join a record's room when your PostPolicy allows update, or view for a read-only room.

Use it from your stack ​

php
use SolutionForest\Collaboration\Livewire\WithCollaboration;
use SolutionForest\Collaboration\Room;

class EditPost extends Component
{
    use WithCollaboration;

    public Post $post;
    public string $title = '';
    public string $status = '';

    public function room(): Room
    {
        return $this->post->collaboration();
    }

    public function save(): void
    {
        $this->saveCollaboratively();   // updates the post with everybody's edits
    }
}
blade
<form wire:submit="save">
    <x-collaboration::room :room="$this->collaborationRoom()" />

    <input wire:model="title">
    <select wire:model="status">...</select>
</form>

That is all: inputs with wire:model on a room field become collaborative, whatever the modifier (.live, .blur). For a Livewire form object, pass state-path="form" to the component and statePath: 'form' to saveCollaboratively(). For a rich text field, see Rich text.

TypeScript: every entry point ships with type declarations. form.field() only accepts the form's own field names.

LivewireReactVue
Join the room<x-collaboration::room>useCollaborativeForm()useCollaborativeForm()
Text, select, checkbox, radio, groupwire:model{...form.field('title')}v-collaborate="form.field('title')"
Your own undobuilt inbuilt inbuilt in
Locked fieldsbuilt inbuilt inbuilt in
Rich textTipTap + Collaborative<CollaborativeEditor><CollaborativeEditor>
Facesbuilt in<Avatars><Avatars>
Who is in a field<x-collaboration::field-people><FieldPeople><FieldPeople>
Sync statusbuilt in<Status><Status>
SavesaveCollaboratively()$room->update()$room->update()
The same moment in React, Vue and Livewire

Want a full copy-pasteable example page? Follow Your first collaborative page step by step. Building your own input, picker, or editor component? See Make your own component live.

Released under the MIT License.