docs: update all documentation for refactored naming conventions

- CanComment trait replaces IsCommenter
- Commentator interface replaces Commenter
- Models moved to Models\ namespace (Comment, Reaction, Attachment, Subscription)
- commenter_type/commenter_id columns replace user_type/user_id
- CommentsConfig replaces Config class
- table_names config key replaces tables
- getCommentDisplayName() replaces getCommentName()
This commit is contained in:
manukminasyan
2026-03-27 15:01:50 +04:00
parent b2ee8a1036
commit a4d4418963
10 changed files with 71 additions and 58 deletions

View File

@@ -20,8 +20,8 @@ The main comments table with polymorphic relationships and threading support.
| `id` | bigint | Primary key |
| `commentable_type` | string | Polymorphic model type |
| `commentable_id` | bigint | Polymorphic model ID |
| `user_type` | string | Commenter model type |
| `user_id` | bigint | Commenter model ID |
| `commenter_type` | string | Commenter model type |
| `commenter_id` | bigint | Commenter model ID |
| `parent_id` | bigint (nullable) | Parent comment for replies |
| `body` | text | HTML comment content |
| `edited_at` | timestamp (nullable) | When the comment was last edited |
@@ -39,12 +39,12 @@ Tracks emoji reactions per user per comment.
|--------|------|-------------|
| `id` | bigint | Primary key |
| `comment_id` | bigint | Foreign key to comments |
| `user_type` | string | Reactor model type |
| `user_id` | bigint | Reactor model ID |
| `commenter_type` | string | Reactor model type |
| `commenter_id` | bigint | Reactor model ID |
| `reaction` | string | Reaction key (e.g., `thumbs_up`) |
| `created_at` | timestamp | |
**Unique constraint:** `(comment_id, user_id, user_type, reaction)`
**Unique constraint:** `(comment_id, commenter_id, commenter_type, reaction)`
### comment_mentions
@@ -54,11 +54,11 @@ Tracks @mentioned users per comment.
|--------|------|-------------|
| `id` | bigint | Primary key |
| `comment_id` | bigint | Foreign key to comments |
| `user_type` | string | Mentioned user model type |
| `user_id` | bigint | Mentioned user model ID |
| `commenter_type` | string | Mentioned user model type |
| `commenter_id` | bigint | Mentioned user model ID |
| `created_at` | timestamp | |
**Unique constraint:** `(comment_id, user_id, user_type)`
**Unique constraint:** `(comment_id, commenter_id, commenter_type)`
### comment_subscriptions
@@ -69,11 +69,11 @@ Tracks which users are subscribed to comment threads on specific models.
| `id` | bigint | Primary key |
| `commentable_type` | string | Subscribed model type |
| `commentable_id` | bigint | Subscribed model ID |
| `user_type` | string | Subscriber model type |
| `user_id` | bigint | Subscriber model ID |
| `commenter_type` | string | Subscriber model type |
| `commenter_id` | bigint | Subscriber model ID |
| `created_at` | timestamp | |
**Unique constraint:** `(commentable_type, commentable_id, user_type, user_id)`
**Unique constraint:** `(commentable_type, commentable_id, commenter_type, commenter_id)`
### comment_attachments
@@ -96,11 +96,11 @@ Stores file attachment metadata for comments.
```
Commentable Model (e.g., Project)
└── comments (morphMany)
├── user (morphTo → User)
├── commenter (morphTo → User)
├── parent (belongsTo → Comment)
├── replies (hasMany → Comment)
├── reactions (hasMany → CommentReaction)
├── attachments (hasMany → CommentAttachment)
├── reactions (hasMany → Reaction)
├── attachments (hasMany → Attachment)
└── mentions (morphToMany → User)
```