01 - Preheat the oven to 350°F. Grease and line two 9-inch round cake pans with parchment paper.
02 - In a medium bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger.
03 - In a large bowl, whisk granulated sugar, brown sugar, vegetable oil, eggs, and vanilla extract until smooth and well combined.
04 - Gradually add the dry mixture to the wet ingredients, stirring until just combined.
05 - Fold in the grated carrots and, if using, the chopped nuts and raisins.
06 - Divide batter evenly between prepared pans and smooth the tops. Bake for 40 to 45 minutes, or until a toothpick inserted in the center comes out clean.
07 - Allow cakes to cool in pans for 10 minutes before transferring to a wire rack to cool completely.
08 - Beat cream cheese and butter together until smooth and creamy. Add powdered sugar, vanilla extract, and salt, then beat until light and fluffy.
09 - Once cakes are fully cooled, spread a layer of frosting on one cake. Place second cake on top and frost the top and sides evenly.
10 - Optionally, garnish with extra nuts or carrot shavings as desired.