01 - Preheat oven to 350°F. Grease and line two 9-inch round cake pans with parchment paper.
02 - In a large bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger.
03 - In a separate bowl, beat vegetable oil, granulated sugar, and brown sugar until combined. Incorporate eggs one at a time, mixing thoroughly after each addition. Stir in vanilla extract.
04 - Gradually add the dry ingredients to the wet mixture. Mix just until the batter is cohesive, ensuring not to overwork.
05 - Gently fold in finely grated carrots, chopped walnuts, and raisins if using. Ensure even distribution.
06 - Divide the batter evenly between the prepared cake pans and smooth the tops with a spatula.
07 - Place pans in oven and bake for 40 to 45 minutes. When a toothpick inserted in the center emerges clean, cakes are done. Cool cakes in pans for 10 minutes, then turn out onto wire racks to cool fully.
08 - Beat softened cream cheese and butter together until creamy. Add sifted powdered sugar, vanilla extract, and a pinch of salt; blend until smooth and airy.
09 - Place one layer on a serving plate. Spread with frosting. Add second layer and cover top and sides with remaining frosting. Garnish with extra walnuts if desired.
10 - Refrigerate assembled cake for at least 30 minutes to set frosting before slicing and serving.