Hootlex\Friendships\Traits\Friendable::findFriendships PHP Method

findFriendships() private method

private findFriendships ( $status = null, string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
$status
$groupSlug string
return Illuminate\Database\Eloquent\Collection
    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;
    }