FluxBB\Actions\SubscribeTopic::run PHP Method

run() protected method

protected run ( )
    protected function run()
    {
        $tid = $this->get('id');
        $topic = Topic::findOrFail($tid);
        $user = User::current();
        if (!$topic->subscribers->contains($user)) {
            $topic->subscribers()->attach($user);
            $this->raise(new UserSubscribed($topic, $user));
        }
    }
SubscribeTopic