Prep the pan and air fryer. Line the bottom of a 6-inch cake pan with parchment and lightly grease the sides. Preheat your air fryer to 320°F (160°C) for 3–5 minutes if your model requires preheating.
Mix dry ingredients. In a medium bowl, whisk flour, granulated sugar, brown sugar, baking powder, baking soda, salt, cinnamon, and nutmeg until combined and lump-free.
Combine wet ingredients. In a separate bowl, whisk eggs, oil, and vanilla until smooth and slightly thickened.
Bring the batter together. Add the wet mixture to the dry ingredients and stir gently with a spatula until just combined.
Do not overmix.
Fold in carrots and add-ins. Stir in grated carrots and, if using, the well-drained crushed pineapple, nuts, and raisins. The batter will be thick and moist.
Fill the pan. Pour batter into the prepared pan and smooth the top. Tap the pan lightly on the counter to release air bubbles.
Bake in the air fryer. Place the pan in the air fryer basket.
Cook at 320°F (160°C) for 28–34 minutes, until the top is set and a toothpick inserted in the center comes out with a few moist crumbs.
Cool completely. Let the cake cool in the pan for 10 minutes, then run a knife around the edge, turn out onto a rack, peel off the parchment, and cool completely before frosting.
Make the frosting. Beat cream cheese and butter until smooth. Add powdered sugar, vanilla, and a pinch of salt. Beat until fluffy and spreadable.
If too thick, add 1–2 teaspoons milk; if too thin, add more powdered sugar.
Frost and finish. Spread frosting over the cooled cake. Top with extra chopped nuts or a light dusting of cinnamon if you like. Slice and serve.