Laravel Eloquent Eager Loading : Join same table twice
问题 I have a users table and an appointments table. In appointment table I have two user ID's (customer_id, staff_id). I want to retrieve all the appointments with customer name and the staff name. users table id name appointments table id staff_id(user_id) customer_id(user_id) datetime As you can see, I have to join the users table twice with the appointments table. Usually I do this with inner joins . Can we do the same thing with Laravel eloquent eager loading using with()? Can we do something