There is a recipe table (rec), a table of ingredients (ing), and a link table (rec_ing). The rec_ing table has the form:
id | rec_id | ing_id Accordingly, the recipe can be associated with several ingredients, and each ingredient can be used in different recipes.
Question: Having a list of ingredients you need to get a list of recipes that can be prepared from these ingredients.
For example: A juice recipe can contain 2 ingredients - an apple and a pear, and a bread recipe - flour and milk. If we have 3 ingredients (apple, pear, flour) and unload recipes for these ingredients, we should get only a juice recipe, since for bread we do not have enough flour ingredient.
How to implement it in Yii2?