public function scopeForUserContext($query, Context $context)
    {
        if ($context->hasRole('Coach')) {
            return $query->whereHas('member', function ($query) use ($context) {
                /** @noinspection PhpUndefinedMethodInspection */
                $query->where('team_id', $context->team_id);
            });
        }
        return $query->where('inviter_id', $context->id);
    }