---
title: "Events — Comments for Laravel | Roundly"
description: "Nine events — created, updated, deleted, approved, hidden, thread locked and unlocked, mentioned and transferred — for notifications and audits."
url: https://roundly-consulting.com/open-source/docs/comments-for-laravel/events
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Comments for Laravel](https://roundly-consulting.com/open-source/docs/comments-for-laravel.md)

# Events

Each lifecycle step dispatches an event under RoundlyConsulting\\Comments\\Events, carrying the comment on its $comment property (CommentMentioned carries $mention; CommentsTransferred carries $from, $to and $count):

| Event | Payload | When |
| --- | --- | --- |
| `CommentCreated` | $comment | A comment row is created — any write, including factories. |
| `CommentUpdated` | $comment | A body is edited through Comments::update(). |
| `CommentDeleted` | $comment | A comment is soft-deleted (single or deleteAll()). |
| `CommentApproved` | $comment | A comment is approved (single or approveAll()). |
| `CommentHidden` | $comment | A comment is hidden — by a moderator, hideAll() or the auto-hide listener. |
| `CommentThreadLocked` | $comment | lockThread() or lockReplies() actually locks the thread under the comment. |
| `CommentThreadUnlocked` | $comment | unlockThread() or unlockReplies() actually lifts the lock. |
| `CommentMentioned` | $mention | An approved comment mentions a resolved person it has not notified yet — on write, edit or approval; once per person. |
| `CommentsTransferred` | $from, $to, $count | Comments::transfer() moved the comments of $from onto $to — also when $count is 0. |

```php
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Notification;
use RoundlyConsulting\Comments\Events\CommentCreated;

Event::listen(function (CommentCreated $event): void {
    // $event->comment is the freshly created Comment
    Notification::send(
        $event->comment->commentable,
        new NewCommentNotification($event->comment),
    );
});
```

The events use SerializesModels, so queued listeners work out of the box. Restoring a comment dispatches no event. Like and report events come from Likes for Laravel and Reports for Laravel.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/comments-for-laravel.md)
