Preheat oven to 400°F (200°C)
Roll out puff pastry on a lightly floured surface. Fit into a tart pan, trimming excess.
Prick the base with a fork and chill in the refrigerator while preparing the filling.
Heat olive oil in a skillet over medium heat.
Add onion and garlic; sauté until softened and fragrant.
Add mushrooms and cook until moisture releases and mushrooms begin to brown.
Season with salt, pepper, thyme, and parsley. Remove from heat and cool slightly.
In a bowl, mix ricotta, Parmesan, and beaten eggs.
Fold in the mushroom mixture until well combined.
Pour filling into prepared crust and spread evenly.
Bake for 25–30 minutes , until golden and set
Cool slightly before slicing. Serve warm or at room temperature.