src/Subscriptions/StorageManager.php
public function subscribersByTopic(string $topic)
    {
        $key = self::TOPIC_KEY.".{$topic}";

        if (! $this->cache->has($key)) {
            return new Collection;
        }

        $channels = json_decode($this->cache->get($key), true);

        return (new Collection($channels))
            ->map(function (string $channel): ?Subscriber {
                return $this->subscriberByChannel($channel);
            })
            ->filter()
            ->values();
    }
public function subscribersByTopic(string $topic)
    {
        $key = self::TOPIC_KEY.".{$topic}";

        if (! $this->cache->has($key)) {
            return new Collection;
        }

        $channels = json_decode($this->cache->get($key), true);

        return (new Collection($channels))
            ->map(function (string $channel): ?Subscriber {
                return $this->subscriberByChannel($channel);
            })
            ->filter()
            ->values();
    }
public function subscribersByTopic ( string $ topic ) { $ key = self :: TOPIC_KEY . ".{$topic}" ; if ( ! $ this -> cache -> has ( $ key ) ) { return new Collection ; } $ channels = json_decode ( $ this -> cache -> get ( $ key ) , true ) ; return ( new Collection ( $ channels ) ) -> map ( function ( string $ channel ) : ? Subscriber { return $ this -> subscriberByChannel ( $ channel ) ; } ) -> filter ( ) -> values ( ) ; }
Get collection of subscribers by channel.

@param  string  $topic
@return \Illuminate\Support\Collection<\Nuwave\Lighthouse\Subscriptions\Subscriber>
Get collection of subscribers by channel .