Preheat oven to 400. Grease or spray a 9×13 pan. Layer the bottom with sliced zucchini. Spread 1/2 the pesto over the sliced squash, 1/2 of the corn, 1/2 of the onion slices, 1/2 of mixed shredded cheese, ending with mozzarella cheese. Salt and pepper.
Repeat the layer again ending with fresh tomato slices on top of the mozzarella cheese; salt and pepper that layer.
Spread fresh basil leaves on top.
Place a large piece of foil over the pan to seal.
Bake at 400 for 30 minutes, until squash is tender but not overcooked.
Let sit for 10 minutes before serving. Serve with crunchy bread.