Preheat & Prepare
Preheat oven to 350°F.
Grease and line two 9-inch round cake pans with parchment paper.
Finely grate carrots and set aside.
Mix Dry Ingredients
In a large bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
Mix Wet Ingredients
In another bowl, whisk granulated sugar, brown sugar, eggs, oil, and vanilla until smooth and combined.
Combine
Gradually add dry ingredients into wet ingredients. Stir until just combined.
Fold in grated carrots (and nuts or raisins if using).
Do not overmix.
Bake
Divide batter evenly between prepared pans.
Bake for 30–35 minutes, or until a toothpick inserted in the center comes out clean or with a few moist crumbs.
Cool
Let cakes cool in pans for 10 minutes.
Transfer to wire rack and cool completely before frosting.
Prepare Frosting
Beat cream cheese and butter until smooth and creamy.
Gradually add powdered sugar until desired sweetness and thickness.
Mix in vanilla extract.
Assemble
Spread frosting over the first cake layer.
Add second layer and frost top and sides.
Refrigerate 30 minutes before slicing for clean cuts.