Files
relaticle-comments/docs/content/2.essentials/4.reactions.md
2026-03-27 00:29:57 +04:00

1.4 KiB

title, description, navigation, seo
title description navigation seo
Reactions Emoji reactions on comments.
icon
i-lucide-smile
description
Configure emoji reactions for comments.

Default Reactions

Six emoji reactions are available out of the box:

Key Emoji Label
thumbs_up 👍 Like
heart ❤️ Love
celebrate 🎉 Celebrate
laugh 😄 Laugh
thinking 🤔 Thinking
sad 😢 Sad

How Reactions Work

  • Each user can add one reaction of each type per comment
  • Clicking the same reaction again removes it (toggle behavior)
  • The reaction summary shows which users reacted with each emoji
  • A CommentReacted event is dispatched with action: 'added' or 'removed'

Customizing Reactions

Override the emoji set in your config:

// config/comments.php
'reactions' => [
    'emoji_set' => [
        'thumbs_up' => "\u{1F44D}",
        'thumbs_down' => "\u{1F44E}",
        'heart' => "\u{2764}\u{FE0F}",
        'fire' => "\u{1F525}",
        'eyes' => "\u{1F440}",
    ],
],

Keys are stored in the database. If you change a key, existing reactions with the old key will no longer display.

Storage

Reactions are stored in the comment_reactions table with a unique constraint on (comment_id, user_id, user_type, reaction), ensuring one reaction of each type per user per comment.