Preheat your oven to 350°F (175°C) and grease and line your cake pans with parchment paper.
Mix the flour, baking powder, baking soda, cinnamon, nutmeg, and salt in a bowl.
In a separate bowl, beat the eggs, oil, sugar, and vanilla with an electric mixer until smooth and creamy.
Fold in the grated carrots, and if using, the walnuts and raisins.
Gradually add the dry ingredients to the wet, mixing until just combined.
Pour the batter evenly into the prepared pans and bake for 25-30 minutes, or until a toothpick inserted in the center comes out clean.
Cool the cakes in the pans for 10 minutes, then turn out onto a wire rack to cool completely.
For the frosting, beat the cream cheese and butter together until smooth. Gradually add the powdered sugar and vanilla, and beat until creamy.
Frost the cooled cakes and stack them.