janalis / collaborate
Live collaboration for Symfony admin forms: shared drafts, presence and cursors over Mercure, with an EasyAdmin adapter.
Requires
- php: ^8.4
- doctrine/dbal: ^4.2
- doctrine/doctrine-bundle: ^2.13 || ^3.0
- doctrine/orm: ^3.3
- psr/clock: ^1.0
- psr/log: ^3.0
- symfony/cache: ^7.4 || ^8.0
- symfony/clock: ^7.4 || ^8.0
- symfony/config: ^7.4 || ^8.0
- symfony/console: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/event-dispatcher: ^7.4 || ^8.0
- symfony/form: ^7.4 || ^8.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
- symfony/mercure: ^0.8 || ^0.9
- symfony/mercure-bundle: ^0.5 || ^0.6
- symfony/property-access: ^7.4 || ^8.0
- symfony/rate-limiter: ^7.4 || ^8.0
- symfony/routing: ^7.4 || ^8.0
- symfony/security-bundle: ^7.4 || ^8.0
- symfony/security-csrf: ^7.4 || ^8.0
- symfony/translation-contracts: ^3.5
- symfony/twig-bundle: ^7.4 || ^8.0
Requires (Dev)
- carthage-software/mago: ^1.30
- easycorp/easyadmin-bundle: ^5.0
- gedmo/doctrine-extensions: ^3.13
- infection/infection: ^0.35.8
- phpunit/phpunit: ^12.5
- symfony/asset-mapper: ^7.4 || ^8.0
- symfony/browser-kit: ^7.4 || ^8.0
- symfony/css-selector: ^7.4 || ^8.0
- symfony/monolog-bundle: ^3.10 || ^4.0
- symfony/translation: ^7.4 || ^8.0
- symfony/yaml: ^7.4 || ^8.0
Suggests
- easycorp/easyadmin-bundle: Shared drafts on EasyAdmin edit and new forms, and live refresh of saved lists
- gedmo/doctrine-extensions: Locale-specific draft fields for Gedmo translatable properties
- symfony/asset-mapper: Serves the bundle's JavaScript and reads the pinned CKEditor version
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-03 05:20:03 UTC
README
collaborate
Live collaboration for Symfony admin pages.
Shared form drafts · presence and cursors · saved-view refresh · over Mercure, no Node service
Documentation · Getting started · Configuration · Rich text · EasyAdmin
janalis/collaborate is a Symfony bundle that lets several people work on
the same admin page at once:
- Shared drafts. Editors of the same record share one durable draft. Text, rich text (CKEditor 5's own operations and transformations, undo included), choices and collections stay in sync. Save goes through the form's usual validation and persistence; a conflicting save elsewhere opens a review, and Discard resets the draft for everyone.
- Presence and cursors. The header shows who else is on the page; their pointers, carets, selections and the field each one is in are drawn in their color.
- Saved-view refresh. Lists and detail pages reload when a save elsewhere changes what they show.
It runs on PHP and a Mercure hub (FrankenPHP's built-in hub works). Draft content lives in MariaDB or MySQL; the hub only carries invalidations and presence, never form content. The bundle is a framework-level core plus an EasyAdmin adapter: without EasyAdmin, a small form-context service is all a page needs.
Install
composer require janalis/collaborate
Requirements: PHP 8.4+, Symfony 7.4 or 8, Doctrine ORM 3 on MariaDB or
MySQL 8, symfony/mercure-bundle and a Mercure hub, Symfony AssetMapper.
See Installation
for the routes, the tables, the purge cron and the hub.
Quick start
// config/routes/collaborate.php return static function (RoutingConfigurator $routes): void { $routes->import('@CollaborateBundle/config/routes.php')->prefix('/admin'); };
# config/packages/collaborate.yaml collaborate: drafts: enabled: true rich_text: block_prefixes: [rich_text] # form types rendered as CKEditor fields
{# in the admin layout #} {{ collaborate_presence() }} {# where the avatars go, e.g. the header #} {{ collaborate_layer() }} {# once, before </body> #}
// the page's script, before anything that wraps window.fetch import '@janalis/collaborate/easyadmin.js';
With EasyAdmin, edit and new pages then share drafts. Rich-text editors get
the Collaborate CKEditor plugin and the draft's configuration from
sessionFor(field); see
Getting started
and Rich text and scripts.
Configuration
Every option lives under the collaborate key, with defaults that work on a
standard admin: who a user is and what they may edit, the hub and its
topics, cursor timing, draft limits, compaction, purge and locks, and the
saved-view refresh. See
Configuration
for the full reference and
Identity and access
for the two services most applications provide.
Contributing
Contributions are welcome: bug reports with the smallest page or form that shows the problem, fixes and tests. Read CONTRIBUTING.md and the contributor guide.
make install # Composer, npm and the test applications' assets make verify # composer validate, mago fmt/lint/analyze, PHPUnit, Vitest
License
MIT.