Skip to content

Conversation

@navneetrai
Copy link
Member

@navneetrai navneetrai commented Aug 11, 2025

Fixes #10

This pull request introduces a new subscription feature to the comment system, allowing users to subscribe to commentable entities and receive notifications when new comments are posted. It adds support for managing subscriptions, dispatching distinct events for subscribers, and configuring notification behavior. The most important changes are grouped below.

Subscription Feature Implementation:

  • Added a new CommentSubscription model and corresponding migration to store subscriptions, enabling users to subscribe to any commentable entity. [1] [2]
  • Extended the HasComments trait with methods to subscribe, unsubscribe, and retrieve subscribers for a commentable entity.

Event Dispatching and Configuration:

  • Introduced the UserIsSubscribedToCommentableEvent event and updated the comment creation logic to dispatch this event to subscribers, with configuration to optionally treat subscribers as mentions instead. [1] [2] [3]
  • Updated documentation to reflect new events and configuration options for subscriptions. [1] [2]

Testing and Migration Registration:

  • Added comprehensive tests to verify event dispatching for subscribers and registered the new migration in the service provider and test setup. [1] [2] [3]
CleanShot 2025-08-13 at 18 25 57@2x CleanShot 2025-08-13 at 16 57 20@2x CleanShot 2025-08-13 at 16 57 09@2x

@navneetrai navneetrai self-assigned this Aug 11, 2025
@navneetrai navneetrai force-pushed the issue-10-subscribed-users branch from 66581a0 to 9e14fd0 Compare August 14, 2025 00:29
@navneetrai navneetrai force-pushed the issue-10-subscribed-users branch from f2734aa to 5ab8788 Compare August 14, 2025 01:10
@navneetrai navneetrai merged commit a98ca42 into main Sep 9, 2025
2 of 6 checks passed
@navneetrai navneetrai deleted the issue-10-subscribed-users branch September 9, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to fire UserWasMentionedEvent or new Event for "subscribed" users

2 participants