laravel-friendships icon indicating copy to clipboard operation
laravel-friendships copied to clipboard

How to work getFriends() function

Open physio opened this issue 8 years ago • 2 comments

Why the $model->getFriends() function return only the friend that has the same model of $model?

physio avatar Feb 09 '17 10:02 physio

Could you provide a failing test for this issue?

hootlex avatar Apr 09 '17 18:04 hootlex

@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?

fortael avatar Jul 15 '17 11:07 fortael