hootlex / laravel-friendships

This package gives Eloquent models the ability to manage their friendships.
MIT License
703 stars 151 forks source link

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

Open patterueldev opened 4 years ago

patterueldev commented 4 years ago

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?

ronssij commented 4 years ago

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

What about this? It's on their docs