In a large 12'' saucepan or skillet (make sure it has a tight-fitting lid), heat the olive oil over medium-high heat. Add the onion and sliced zucchini, sautéeing until the onions are translucent and the zucchini is tender.
Add the garlic and fry for 1 more minute. Pour in the spinach, stirring until wilted. Add the beans, pesto, parmesan cheese, and around half of the water/broth. Stir until everything is well combined—add more water or broth as needed to form a thick, saucy consistency. Taste to check for seasoning and allow to come to a simmer.
Once bubbling, make 6 wells into the pesto sauce with a large spoon. Crack an egg into each well, then cover the skillet and adjust the heat to low. Let the eggs cook for 7 to 10 minutes, until the whites are set. The yolks should be cooked just under your liking, as the residual heat will continue to cook the eggs as it sits.
Remove the skillet from the heat and garnish the shakshuka with toasted pine nuts and parmesan, if using. Serve warm with toasted bread and enjoy!