Heat some oil in a saucepan and fry the onion cut into cubes. When the onion is translucent, add the packet of spinach and the cloves of garlic. Let it simmer and add some water. Stir often to prevent the spinach from sticking. When all the spinach has boiled down, add the cream cheese. Stir again. At the same time, cook the spaghetti al dente and arrange the pasta and sauce in a bowl.