marko / broadcasting-mercure
Mercure hub broadcasting driver for Marko Framework
Package info
github.com/marko-php/marko-broadcasting-mercure
Type:marko-module
pkg:composer/marko/broadcasting-mercure
0.11.0
2026-10-06 13:34 UTC
Requires
- php: ^8.5
- marko/authentication: 0.11.0
- marko/broadcasting: 0.11.0
- marko/clock: 0.11.0
- marko/config: 0.11.0
- marko/core: 0.11.0
- marko/http: 0.11.0
- marko/routing: 0.11.0
Requires (Dev)
- marko/testing: 0.11.0
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-06 15:40:23 UTC
README
Mercure broadcasting driver --- publish realtime updates through a Mercure hub, including the one built into FrankenPHP.
Installation
composer require marko/broadcasting-mercure
This installs marko/broadcasting. You also need an HTTP client driver such as marko/http-guzzle.
Quick Example
use Marko\Broadcasting\PrivateChannel; // Publish (BroadcasterInterface is bound to MercureBroadcaster) $broadcaster->broadcast('shows.42', 'seat.sold', ['seat' => 'A1']); // Let the browser subscribe, authorizing private topics via the mercureAuthorization cookie $channels = ['shows.42', new PrivateChannel('customers.7')]; $hubUrl = $mercureSubscriberToken->subscribeUrl($channels); $response = $mercureSubscriberToken->withAuthorizationCookie($response, $channels, $guard->user());
Documentation
Full usage, API reference, and examples: marko/broadcasting-mercure