01 - Preheat oven to 350°F. Grease and line two 9-inch round cake pans with parchment paper.
02 - Whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, cloves, and ginger in a large bowl.
03 - Beat vegetable oil, granulated sugar, and brown sugar until combined. Add eggs one at a time, beating well after each addition. Stir in vanilla extract.
04 - Gradually fold the dry ingredients into the wet mixture until just combined.
05 - Fold in grated carrots, walnuts, and raisins if using.
06 - Divide batter evenly between prepared pans and smooth the tops.
07 - Bake for 40 to 45 minutes or until a toothpick inserted comes out clean. Let cool in pans for 15 minutes, then transfer to a wire rack to cool completely.
08 - Beat cream cheese and butter until creamy. Gradually add powdered sugar, vanilla, and salt, beating until smooth and fluffy.
09 - Once cooled, spread frosting between layers and over the entire cake. Optionally, garnish with extra walnuts.