public function scopeHavingRoles($query, array $roles)
    {
        return $query->whereExists(function ($query) use ($roles) {
            $query->selectRaw('1')
                  ->from('role_user')
                  ->whereRaw('role_user.user_id = users.id')
                  ->whereIn('role_id', $roles);
        });
    }