Whenever somebody creates a comments, this package can send a notification when comments are made. Out of the box such a notification is always an email.
##Subscribing to notifications
You can let a user subscribe to notifications like this:
This will send a notification to
$user whenever a comment is posted by anyone to the given
You can also only send a notification to
$user when a new comment is posted on things that
$user already commented on. For the behaviour, use
##Unsubscribing from notifications
Here's how you can unsubscribe a user from getting notified when a new comment is posted
To let a user unsubscribe from all notifications for all models, you can use this method:
Out of the box, this package will send notifications as emails.
You can customize the content of the mail by publishing the views:
php artisan vendor:publish --tag="comments-views"
You'll find the Blade views to customize in
To customize the notifications itself (to for instance add new channels) you create your own notification class that extends either
Spatie\Comments\Notifications\ApprovedCommentNotification. You should specify your class name in the
approved_comment key of the
comments config file.