Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow Request accept on the wrong side? #72

Closed
xewl opened this issue Jul 1, 2020 · 1 comment
Closed

Follow Request accept on the wrong side? #72

xewl opened this issue Jul 1, 2020 · 1 comment

Comments

@xewl
Copy link

xewl commented Jul 1, 2020

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
Copy link
Author

xewl commented Jul 1, 2020

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

@xewl xewl closed this as completed Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant