Clean and wash the broccoli and cut it into small florets. Cook the broccoli in plenty of boiling salted water for about 4 minutes. Cook the pasta according to the instructions on the packet. Drain everything, rinse with cold water and drain well.
Peel and finely chop the onion. Peel garlic and chop finely. Heat oil in a pot. Fry onion and garlic briefly. Deglaze with cream and 150 ml water. Bring to the boil and simmer everything for 3-4 minutes. Stir in pesto. Season sauce with salt and pepper and remove from heat.
Preheat oven (electric cooker: 200 °C/circulating air: 175 °C/gas: see manufacturer). Grease four small or one large casserole dish. Season the pasta-broccoli mixture with pepper, nutmeg and possibly some salt. Spread into the moulds. Pour sauce over it. Form a small hollow in the middle of each form. Beat in 1 egg each. Grate the mozzarella coarsely and sprinkle over it. Bake in a hot oven for about 15 minutes.