diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index f1f1853..e80bae5 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -31,5 +31,31 @@ public function bootAddon() '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(), + 'title' => $user->title(), + 'email' => $user->email(), + 'avatar' => $user->avatar(), + 'initials' => $user->initials(), + ]; + }); } }