private function findFriendships($status = null, $groupSlug = '')
{
$query = Friendship::where(function ($query) {
$query->where(function ($q) {
$q->whereSender($this);
})->orWhere(function ($q) {
$q->whereRecipient($this);
});
})->whereGroup($this, $groupSlug);
//if $status is passed, add where clause
if (!is_null($status)) {
$query->where('status', $status);
}
return $query;
}