renoki-co/befriended

Follow Request accept on the wrong side?

xewl opened this issue · 1 comments

xewl commented

It seems to me, that the order in which the models can accept a request has been reversed.
This issue is mostly to see whether I'm wrong in this or not...

// Grabbing the requests towards the currently authenticated user:
$requests = Auth::user()->followRequests()->get();

// ..

// getting the user that requested, irrelevant
$user = User::findOrFail($a_request->id); 

// what I expected to work:
// Auth::user()->acceptFollowRequest($user);

// what actually worked:
$user->acceptFollowRequest(Auth::user());

My User model is set-up to be able to follow & be followed

use Rennokki\Befriended\Traits\Follow;
use Rennokki\Befriended\Contracts\Following;

class User extends Authenticatable implements MustVerifyEmail, Following
{
    use Follow;
xewl commented

Nvm, I reversed followerRequests with followRequests (。_。)