where('id', $userId)->value('uuid'); return is_string($u) && $u !== '' ? $u : null; } /** * @param array $data */ public static function publish(int $userId, string $event, array $data): void { $uuid = self::uuidForUserId($userId); if ($uuid === null) { return; } try { self::createApi()->trigger(self::channelName($uuid), $event, $data); } catch (Throwable) { } } }