Thinly slice the fennel and onion. Finely grate or chop the garlic, if using.
Heat a little olive oil in a frying pan and gently sauté the onion and fennel until softened and lightly caramelised.
Add the garlic and stir for a few seconds, taking care not to let it burn.
Add the peas and a splash of water. Cook for about 5 minutes, until the peas are tender and the liquid has evaporated.
Meanwhile, whisk the eggs with a little salt and freshly ground black pepper.
Pour the eggs evenly over the vegetables. Scatter over the chopped parsley, then reduce the heat, cover with a lid and cook gently until the frittata is set on top.
If making the cheesy version, scatter over the grated cheese or crumbled feta and place the pan briefly under a hot grill until the cheese has melted and the top is lightly golden. Make sure the frying pan is suitable for use under the grill.
Leave to cool slightly, then cut into wedges or small squares. Serve warm or at room temperature.