feat: reviews

This commit is contained in:
2026-05-18 21:46:54 +02:00
parent bb409610a8
commit 67d838fa65
8 changed files with 358 additions and 2 deletions
+5
View File
@@ -49,6 +49,11 @@ class MealPosts extends Model
return $this->hasMany(MealPostIngredients::class)->orderBy('position');
}
public function reviews(): HasMany
{
return $this->hasMany(PostReviews::class, 'meal_post_id');
}
public function likedByUsers(): BelongsToMany
{
return $this->belongsToMany(User::class, 'meal_post_likes', 'meal_posts_id', 'user_id')