Skip to content

Commit c07996e

Browse files
committed
Explain extending BroadcasterContract better
1 parent 81d41b4 commit c07996e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Bootstrappers/BroadcastingConfigBootstrapper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ public function bootstrap(Tenant $tenant): void
8989
// Swap the currently bound Broadcaster singleton (resolved earlier with the central credentials)
9090
// for the tenant BroadcastManager's default broadcaster, so that anything resolving the Broadcaster
9191
// contract gets the same tenant broadcaster that the manager uses, instead of the stale central one.
92+
// The closure runs immediately (the extended singleton is already resolved), and it's also what makes
93+
// channel auth work in tenant context -- the broadcaster resolved here gets cached as the tenant
94+
// manager's default driver and receives the central channel auth closures (see below).
9295
$this->app->extend(BroadcasterContract::class, function (BroadcasterContract $centralBroadcaster) {
9396
$tenantBroadcaster = $this->app->make(BroadcastManager::class)->connection();
9497

0 commit comments

Comments
 (0)