feat: reviews
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user