01 - Preheat the oven to 350°F. Grease and line two 8-inch round cake pans with parchment paper.
02 - Whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, cloves, and ginger in a medium bowl.
03 - In a large bowl, beat granulated sugar, brown sugar, and vegetable oil until well combined. Add eggs one at a time, mixing thoroughly after each addition. Stir in vanilla extract.
04 - Gradually fold the dry mixture into the wet ingredients until just combined; avoid overmixing.
05 - Fold in grated carrots, nuts, and raisins, if using.
06 - Divide batter evenly between prepared pans and smooth the tops. Bake for 35 to 40 minutes or until a toothpick inserted in the center comes out clean.
07 - Allow cakes to cool in pans for 10 minutes, then remove and transfer to a wire rack to cool completely.
08 - Beat cream cheese and butter until smooth and creamy. Gradually add powdered sugar, vanilla, and salt, beating until fluffy.
09 - Spread a layer of frosting over one cake. Place the second cake on top, then frost the top and sides evenly.
10 - Optionally decorate with extra nuts or a light dusting of cinnamon. Slice and serve.