when($captchaId, function (Builder $query, int $captchaId) { $query->where('id', $captchaId); }) ->where('type', '=', $type) ->count(); } }