Preheat oven to 180°C (350°F) and grease a baking dish.
Heat a little oil in a pan and sauté onion until soft.
Add garlic and cook for 30 seconds until fragrant.
Add spinach and cook until wilted, then remove from heat.
In a large bowl, whisk eggs and milk together.
Stir in cooked spinach mixture and shredded cheese.
Season with salt, black pepper, and chili flakes.
Pour mixture into the prepared baking dish.
Bake for 30–35 minutes until set and lightly golden.
Let it cool slightly, slice, and serve warm.