Combine the onion, carrots, celery, garlic, green beans, tomatoes, broth, and beans in a 6-quart slow cooker. Add the bay leaves, oregano, basil, rosemary, and red pepper flakes. Cover and cook on low for 6-8 hours or on high for 3-4 hours.
30-40 minutes before the soup is done cooking, add in the zucchini, pasta, and spinach. Cook until pasta is tender. Season with salt and black pepper, to taste. Remove bay leaves. Ladle soup into bowls and serve with Parmesan cheese, if desired.
Note-for vegan, don't use the Parmesan cheese and for gluten-free, use gluten-free pasta.