how to perform additional inner join on pivot table with laravel eloquent
问题 I have four tables: foods: id, name users: id, name mealtypes: id, name food_user: id, food_id, user_id, mealtype_id foods and user have a many-to-many relationship mealtype has a one-to-one relationship with food_user In the end I would like to have an instance of a model with the following properties: food.name, users.name, mealtype.name normal sql would be: SELECT f.name, u.name, m.name FROM foods f INNER JOIN food_user fu ON f.id = fu.food_id INNER JOIN users u ON fu.id = u.id INNER JOIN