Add post comments with moderation plus view/like interaction endpoints
Deploy Backend / deploy (push) Successful in 2m41s

- blog_comments table + Comment model/factory; comments attach to the post,
  public list shows approved rows only, public submission starts unapproved
- Admin moderation API: list/filter, approve, delete comments
- Public POST posts/{slug}/view and posts/{slug}/like toggle counters
- Route groups: comments throttled like the contact form, interactions at
  60/min; comments resource exposed to the generic admin list
This commit is contained in:
Parsa Aghayi committed 2026-10-02 11:06:06 -04:00
1 parent fbacb0c9a1
commit e98807da05
11 files changed
+497

No files matched your search

+6
View File
@@ -49,6 +49,12 @@ class Post extends Model
return $this->belongsToMany(Post::class, 'related_posts', 'post_id', 'related_post_id')->withTimestamps();
}
// دیدگاه‌های پست
public function comments()
{
return $this->hasMany(Comment::class);
}
// اسکوپ فیلتر
public function scopeFilter($query, $filters)
{