You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: adapt the Laravel Octane Mercure config to the 1.0 hub
The publisher_jwt and subscriber_jwt directives only work in the compatibility
mode of the hub, which FrankenPHP is built without. Octane writes every entry
of the mercure array as a Caddyfile line, so the issuer block is passed as a
multi-line value.
// The issuer of the access tokens, and the keys verifying them
198
+
'issuer' => <<<'CADDYFILE'
199
+
https://localhost {
200
+
publisher {
201
+
jwt !ChangeThisMercureHubJWTSecretKey!
202
+
}
203
+
subscriber {
204
+
jwt !ChangeThisMercureHubJWTSecretKey!
205
+
}
206
+
}
207
+
CADDYFILE,
199
208
],
200
209
];
201
210
```
202
211
203
-
You can use [all directives supported by Mercure](https://mercure.rocks/docs/hub/config#directives) in this array.
212
+
Octane writes each entry of this array as a `<key> <value>` line of the `mercure` block of the `Caddyfile`, so you can use [all directives supported by Mercure](https://mercure.rocks/docs/hub/config#directives) in it.
213
+
The `publisher_jwt` and `subscriber_jwt` directives of the 0.x hub aren't available: they need a compatibility mode that FrankenPHP doesn't ship, see [the Mercure documentation](mercure.md#enabling-mercure).
204
214
205
215
To publish and subscribe to updates, we recommend using the [Laravel Mercure Broadcaster](https://github.com/mvanduijker/laravel-mercure-broadcaster) library.
206
216
Alternatively, see [the Mercure documentation](mercure.md) to do it in pure PHP and JavaScript.
0 commit comments