public function queryCountUsers($query) {
$query->where(['confirmed' => true])->count();
}
I want to query all the users who are already confirmed and those all users who have role_id of 2 or 3 but How can i do it ?
You could add ->where('role_id',2)->orWhere('role_id',3) to your function, but it's probably a better idea to use Laravel's whereIn function:
$query->where(['confirmed' => true])->whereIn('role_id', [2,3])->count();
This is supported in every version of Laravel.