01 - Preheat oven to 350°F. Grease and line two 9-inch round cake pans or one 9x13-inch pan with parchment paper.
02 - Whisk together flour, baking powder, baking soda, salt, cinnamon, nutmeg, ginger, and cloves in a large bowl.
03 - In a separate bowl, mix granulated sugar, brown sugar, and oil until smooth. Add eggs one at a time, beating well after each addition. Stir in vanilla extract.
04 - Fold the dry mixture into the wet ingredients gradually until just combined.
05 - Gently fold in grated carrots, nuts, and raisins if using.
06 - Divide batter evenly between prepared pans and smooth the top. Bake for 40–45 minutes or until a toothpick inserted in center comes out clean.
07 - Let cakes cool in pans for 10 minutes, then transfer to a wire rack and cool completely.
08 - Beat softened cream cheese and butter until creamy. Add powdered sugar, vanilla, and salt. Beat until fluffy and smooth.
09 - Spread frosting evenly over one cake layer, place second layer on top, then frost top and sides. For sheet cake, frost top generously.
10 - Optionally garnish with nuts or a sprinkle of cinnamon. Slice and serve.