src/Subscriptions/StorageManager.php
public function storeSubscriber(Subscriber $subscriber, string $topic): void
    {
        $topicKey = self::TOPIC_KEY.".{$topic}";
        $subscriberKey = self::SUBSCRIBER_KEY.".{$subscriber->channel}";

        $topic = $this->cache->has($topicKey)
            ? json_decode($this->cache->get($topicKey), true)
            : [];

        $topic[] = $subscriber->channel;

        $this->cache->forever($topicKey, json_encode($topic));
        $this->cache->forever($subscriberKey, $subscriber);
    }
public function storeSubscriber(Subscriber $subscriber, string $topic): void
    {
        $topicKey = self::TOPIC_KEY.".{$topic}";
        $subscriberKey = self::SUBSCRIBER_KEY.".{$subscriber->channel}";

        $topic = $this->cache->has($topicKey)
            ? json_decode($this->cache->get($topicKey), true)
            : [];

        $topic[] = $subscriber->channel;

        $this->cache->forever($topicKey, json_encode($topic));
        $this->cache->forever($subscriberKey, $subscriber);
    }
public function storeSubscriber ( Subscriber $ subscriber , string $ topic ) : void { $ topicKey = self :: TOPIC_KEY . ".{$topic}" ; $ subscriberKey = self :: SUBSCRIBER_KEY . ".{$subscriber->channel}" ; $ topic = $ this -> cache -> has ( $ topicKey ) ? json_decode ( $ this -> cache -> get ( $ topicKey ) , true ) : [ ] ; $ topic [ ] = $ subscriber -> channel ; $ this -> cache -> forever ( $ topicKey , json_encode ( $ topic ) ) ; $ this -> cache -> forever ( $ subscriberKey , $ subscriber ) ; }
Store subscription.

@param  \Nuwave\Lighthouse\Subscriptions\Subscriber  $subscriber
@param  string  $topic
@return void
Store subscription .