From 1b5f750bdeee9a03d9111e2393d1f4c541a65c22 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 19 Mar 2024 22:59:10 +0000 Subject: [PATCH] Support collaboration on globals & taxonomy terms --- src/ServiceProvider.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 55dd497..fc9b779 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -20,7 +20,33 @@ public function boot() Broadcast::channel('entry.{id}.{site}', function ($user, $id, $site) { $user = User::fromUser($user); - + + return [ + 'name' => $user->name(), + 'id' => $user->id(), + 'title' => $user->title(), + 'email' => $user->email(), + 'avatar' => $user->avatar(), + 'initials' => $user->initials(), + ]; + }); + + Broadcast::channel('globals.{set}.{locale}.{site}', function ($user, $set, $locale, $site) { + $user = User::fromUser($user); + + return [ + 'name' => $user->name(), + 'id' => $user->id(), + 'title' => $user->title(), + 'email' => $user->email(), + 'avatar' => $user->avatar(), + 'initials' => $user->initials(), + ]; + }); + + Broadcast::channel('term.{taxonomy}.{id}.{locale}.{site}', function ($user, $taxonomy, $id, $locale, $site) { + $user = User::fromUser($user); + return [ 'name' => $user->name(), 'id' => $user->id(),