Files
relaticle-comments/raw/essentials/reactions.md
github-actions[bot] acc57ac106 Deploy 1.x docs
2026-03-27 10:09:54 +00:00

2.1 KiB

Reactions

Emoji reactions on comments.

Default Reactions

Six emoji reactions are available out of the box:

<th>
  Emoji
</th>

<th>
  Label
</th>
<td>
  :thumbsup:
</td>

<td>
  Like
</td>
<td>
  ❤️
</td>

<td>
  Love
</td>
<td>
  🎉
</td>

<td>
  Celebrate
</td>
<td>
  😄
</td>

<td>
  Laugh
</td>
<td>
  🤔
</td>

<td>
  Thinking
</td>
<td>
  😢
</td>

<td>
  Sad
</td>
Key
thumbs_up
heart
celebrate
laugh
thinking
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.