nova-comments
nova-comments copied to clipboard
feat req: connect comments to notifications
just an idea.
when a comment is posted, notify the user owning model or taking part of the discussion via notifications -> https://nova.laravel.com/docs/4.0/customization/notifications.html
@chrillep Interesting idea! If we did add this it would have to be disabled by default I think since sending notifications requires additional configuration outside what this package should be handling (for example setting up database notifications).
One question I have though is what do you mean by "user owning model", how would you know which user "owns" a model?
yes. your right notifications needs setup, so opt-in would be required =) a first would be notifying anyone who has posted on the model.
as for the "user owning model" that would be the user who created the model. And your right this would mean we have to trace this somehow. Now that you brought it up it feels very out of scope or at least to big, for a first implementation. One way to do it, would be to use something like resource events and on creation store it in the action_events table. This table would however get pretty large in time =)
Other than that i would be adding a new comment from the creator on the model. maybe a hidden "commentable_type". Same goes here it will bloat the nova_comments table, but at least it would be narrowed down to the nova-comments package and not be prone to break if nova for some reason changed the action_events table.
What about possibly adding the ability to mention people but using the @ symbol then choosing an autocomplete field or type the email address? Sort of like how github does when you type @ in this comment field. Then this would have the ability to notify the user by getting their user id via a regex expression? Just a thought. I am looking to do something like this currently and stumbled upon this repo.