laravel-friendships icon indicating copy to clipboard operation
laravel-friendships copied to clipboard

How do you check relationship with other user before sending a friend request?

Open patterueldev opened this issue 5 years ago • 1 comments
trafficstars

I can't find a method that will check if there's "an existing record" on the friend request table (I'd have to use Eloquent manually), but there could be a method created to check this right? I mean,

What if the other user is already: Added? Pending Request? Blocked?

Is there a single method to check this?

patterueldev avatar Jan 08 '20 12:01 patterueldev

$user->isFriendWith($friend); $user->hasFriendRequestFrom($sender); $user->hasSentFriendRequestTo($recipient); $user->hasBlocked($friend);

What about this? It's on their docs

ronssij avatar Mar 02 '20 05:03 ronssij