laravel-friendships
laravel-friendships copied to clipboard
How to work getFriends() function
Why the $model->getFriends() function return only the friend that has the same model of $model?
Could you provide a failing test for this issue?
@hootlex
Same problem
id | sender_id | sender_type | recipient_id | recipient_type | status | created_at | updated_at |
---|---|---|---|---|---|---|---|
18 | 1 | App\User | 4 | App\Worker | 1 | ... | ... |
19 | 1 | App\User | 14 | App\Worker | 1 | ... | ... |
$friends = \Auth::user()->getFriends();
dd($friends);
Returns
Collection {#386 ▼
#items: []
}
Also would be great to have a function to find friends only with specific model. Like groups but for model. I know it's hard to select who exactly friend in current relation. But maybe at least in one direction?