Closed kwindo closed 1 year ago
Currently having the exact same issue. @mkwsra any ideas if this is a bug?
@kwindo did you manage to fix it?
Currently having the exact same issue. @mkwsra any ideas if this is a bug?
@kwindo did you manage to fix it?
No @mattvb91 sorry. With all repsect to the creator but I found this plugin insufficiant for what I needed so I build my own.
Actually, you might be in need of another function in this case.
like this one getAllFriendships()
perhaps?
These functions have the same characteristics and are used to filter friendships
by a group you can pass a group slug, only the status you are looking for is different, so you can use them as well if you wish
getAcceptedFriendships()
getDeniedFriendships()
getBlockedFriendships()
getFriendRequests()
is not taking group in consideration.
I hope this helps guys
Currently having the exact same issue. @mkwsra any ideas if this is a bug? @kwindo did you manage to fix it?
No @mattvb91 sorry. With all repsect to the creator but I found this plugin insufficiant for what I needed so I build my own.
Sorry for the late reply, and sorry to hear that, I understand at the same time, and if you think you can contribute that would be great!
Sorry for the late reply, and sorry to hear that, I understand at the same time, and if you think you can contribute that would be great!
I'm sorry, my knowledge of git is rather basic. I don't really know how to contribute to a project or manage one. I did use your code as a base (sensirely hope you don't mind) but did a lot of tweaks.
I'm not an specialist developer so at this point I'm unsure if everything I changed/added is done correctly. Feel free to check the current code here https://github.com/kwindo/laravel-friendships and take what ever you think is usefull.
For sure I don't mind :) it's an open-source world 🤩 Thanks for sharing your repo, this way I can check it out, best of luck with your project 🙌
Noprob, as you can see I did not add documentation but should you have a need for the controller I created in the Laravel project I'm using for developing this package you should be able to download it somewhere in this comment. FriendshipController.php.zip
Yes, I just did, I will see what I can enhance, thanks for using the package
Thanks guys,
just for reference for anyone else heres how I ended up doing it:
public function pendingRequests()
{
return auth()->user()->getFriendRequests()->each(static function(Friendship $friendship) {
$friendship->load('sender'); //Load
return $friendship;
});
}
public function getPendingSentRequests()
{
return auth()->user()->getPendingFriendships()->each(static function(Friendship $friendship) {
return $friendship;
})->pluck('recipient');
}
Hi there,
Thanks for the package. I'v been playing around with it for a while and I seem to run into some strange behaviour.
I created a FriendshipController where I want to call the Auth user's Friendships lists. The friendship requests he received and his pending requests
Both functions output the same results. Not sure if this is a bug or I'm missing something.