///Model Recipe
public function recipeinridientgroup()
{
return $this->hasMany(RecipeIngridientGroup::class, 'recipe_id','id');
}
//модель RecipeIngridientGroup
public function ingridients()
{
return $this->hasMany(RecipeIngridient::class, 'ingridient_group_id', 'id')->get();
}
class RecipeIngridient extends Model
{
////модель RecipeIngridient
public function ingridient_group()
{
return $this->belongsTo(IngridientGroup::class, 'group_id', 'id');
}