Heat the oven to 180C/fan 160C/gas 4. In a 20cm square or round baking dish, put a layer of courgette slices, followed by half the basil and ricotta pesto, half the sliced boiled egg and half the grated pecorino. Continue layering the courgette, pesto, egg and pecorino, finishing with grated pecorino on top. Season well with salt and pepper. Cover with foil and bake in the oven for 20–25 minutes, then finish under a hot grill for 8–10 minutes until golden.