In a stock pot or dutch oven over medium high heat, saute the onions and chopped garlic in a small amount of olive oil until softened. Stir in the carrots and cook a few minutes more.
Add the beans and chopped ham and cover with the broth.
Drop in your herb bundle and bay leaves.
Bring the soup to a vigorous simmer, then reduce the heat so that it's just bubbling. Simmer for until the carrots are tender.
Add this point add the diced zucchini and tomatoes. Cook until warmed through.
Make the pesto by pureeing the basil, remaining two cloves of garlic and 2 tablespoons of olive oil together with a stick blender. Add the Parmesan cheese and blitz to combine. Adjust the texture of the pesto by adding more oil. Season to taste with salt and pepper.
To serve, ladle the soup into bowls and spoon a dollop of pesto on top.