I have one problem where I need help. I'm doing one project in learning purposes.
I have 2 tables, the first one is
USERS which contain id (PK, AI), username, email, password and so on...
Another table called
FRIENDS
contain user_a (FK to users.id), user_b (FK to users.id), status (0 - pending, 1 - confirmed)...
Lets say the current logged user have id 1.
I need to join this 2 tables and get complete friend list for currently logged user, so query trough table friends where user_a or user_b = currently logged user id, and get all data (from table users) for his friend... So lets say this:
user_a = 1, user_b = 2 userb_a = 3, user_b = 1
I need to get info for users 2, 3.
I hope so you understand what I need.
Btw I know how to do this without using Eloquent, but I need to use Eloquent.
Thanks a lot!