1 year ago

Exclude users if a user relationship exists

Posted 1 year ago by Kunzilla

Hi there, i build a small social platform where a user can "follow" a user. I've created a "relation" table with the user ids (A->B, B->A). Now i want to suggest users some other users to follow them. But how can i exclude following users from my query?

User::where('verified', true)->limit($limit)->get();

I tryed it with:


Hope you can help! Thanks!

Please sign in or create an account to participate in this conversation.