Doctors belong to a Practice, which belongs to a User. However, there are some views where it is helpful to list off all of the Doctors attributed to a User, rather than the Practices, then the Doctors.
So you need a doctors() relationship on the User model which implements hasManyThrough()
use where clause instead of find and groupby it will wokred
@Snapey I have tried this, but it appears that since the users and practices relationship is a many to many, and the practices to doctors is a many-to-1, it won't work.
From what I've read, hasManyThrough needs to be a chain of many-to-1s
Please sign in or create an account to participate in this conversation.