Option 1
-
commentsandrepliestable
https://laracasts.com/discuss/channels/eloquent/how-to-get-posts-with-comments-and-replies
Option 2
-
commentstable to store both - This one might feel a little tricky but it is a good design. You really dont need to make two tables. Reply can be considered as comment on another comment.
- A column
parent_idcan be made to link parent comment. A column withparent_idnull means its a comment, and any comment with integerparent_idmeans its a reply to comment if defined in the given column. - In this case you can also achieve nested comments/replies.
- Note that in the following link there are two columns
commentable_type, andcommentable_id. It is used when your application has comments on multiple things like posts, videos etc. In that case this polymorphic approach is useful. But since your application is "little" you might not need these. You can instead have only one columnpost_id
https://www.codecheef.org/article/create-your-own-multilevel-nested-comments-system-in-laravel
Hope this helps @marcolino922
