Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine
Next Chapter

Challenge #1 of 1


Q: 

My chat application is finally ready to become interactive! I've just installed the symfony/ux-turbo-mercure package and set up Mercure in my server. I'm ready to receive messages from other people!

My current template looks like this:

<turbo-stream action="update" target="chat-messages">
    <template>
        {{ include('chat/_messages.html.twig') }}
    </template>
</turbo-stream>

<turbo-stream action="replace" target="chat-user-list">
    <template>
        {{ include('chat/_user-list.html.twig') }}
    </template>
</turbo-stream>

And I now need to listen to a new-messages topic in Mercure in order to receive them. How can I do that?

userVoice