Building Tag filter, and upon trying to filter out the data by tag IDs, I get all the values that have some of the tags sent, but I get those that have at least 1 of those tags, not all of them...How do I make it to get only the items that have all of the sent tags related to them?
return MealItem::with($withParam)->whereHas('MealTag', function($q) use($tags){
$q->whereIn('id', $tags);
},'>=', count($tags))->has('MealIngredient')->get();
source https://stackoverflow.com/questions/73666586/return-only-values-that-have-all-the-necesary-relations
No comments:
Post a Comment