Start by making the batter base. Take a large mixing bowl and whisk the eggs with the sugar and oil until the mixture looks smooth and slightly glossy. Add the vanilla extract along with the crushed pineapple or yogurt, and then mix again until everything is fully blended.
Next, prepare the dry ingredients. In a separate bowl, add the flour, baking soda, baking powder, cinnamon, nutmeg, and salt. Stir lightly so the spices and leavening agents are evenly spread through the flour.
Now bring the two mixtures together. Slowly add the dry ingredients into the wet mixture, stirring gently as you go. Mix only until the flour disappears into the batter. Avoid over mixing, as this can make the cake dense.
Once the batter is ready, fold in the grated carrots, chopped nuts, and raisins. Stir gently until everything is evenly distributed. The batter should be thick and well combined.
Grease a cake pan and pour the batter into it, smoothing the top if needed. Place the pan in the air fryer and cook at 320°F (160°C) for about 30 to 35 minutes.
The cake is done when a toothpick inserted into the center comes out clean. Remove the cake and allow it to cool completely before frosting.
To finish, prepare the frosting by beating the cream cheese and butter together until smooth and creamy. Gradually add the powdered sugar and vanilla, beating until the frosting is light and spreadable. Once the cake has cooled, spread the frosting evenly over the top and serve.