Preheat oven to 350°F (175°C). Grease a 9x13 inch baking dish.
In a large skillet, melt butter over medium heat. Add onion and cook until softened, about 5 minutes. Add garlic and cook for 1 minute more.
Add mushrooms to the skillet and cook until softened and liquid has evaporated, about 10-12 minutes.
Remove from heat and stir in cream cheese, sour cream, salt, and pepper until well combined.
Stir in 1 cup of shredded cheddar cheese and parsley.
Pour the mushroom mixture into the prepared baking dish. Sprinkle with remaining 0.5 cup of cheddar cheese.
Bake for 25-30 minutes, or until golden brown and bubbly.
Let cool slightly before serving.
Notes
For a spicier casserole, add a pinch of red pepper flakes to the mushroom mixture. You can also use a mix of different types of mushrooms for added flavor.