Preheat the oven:
Preheat your oven to 350°F (175°C). Grease and line two 9-inch round cake pans with parchment paper.
Mix the dry ingredients:
In a large bowl, whisk together the flour, baking powder, baking soda, cinnamon, nutmeg, ginger, and salt. Set aside.
Prepare the wet ingredients:
In another bowl, beat the granulated sugar, brown sugar, and vegetable oil until well combined. Add the eggs one at a time, beating well after each addition. Stir in the vanilla extract.
Combine the batter:
Gradually add the dry ingredients to the wet ingredients, mixing just until combined. Fold in the grated carrots, and if desired, the walnuts and raisins.
Bake:
Divide the batter evenly between the prepared pans. Bake for 25-30 minutes, or until a toothpick inserted into the center comes out clean. Let the cakes cool in the pans for 10 minutes before transferring them to a wire rack to cool completely.
Make the frosting:
In a large bowl, beat the cream cheese and butter together until smooth and creamy. Gradually add the powdered sugar, one cup at a time, beating well after each addition. Stir in the vanilla extract and a pinch of salt.
Assemble the cake:
Once the cakes are completely cooled, place one layer on a serving plate and spread a generous amount of frosting on top. Place the second layer on top and frost the top and sides of the cake.
Decorate and serve:
Garnish the cake with additional chopped nuts or shredded carrots, if desired. Slice and serve!