FluxBB\Actions\UnsubscribeTopic::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->id)) {
            $topic->subscribers()->detach($user);
            $this->raise(new UserUnsubscribed($topic, $user));
        }
    }
UnsubscribeTopic