Cook the pasta in a large pot of boiling salted water until just al dente, then drain and set aside.
Heat olive oil in a sauté pan over medium heat and add the minced garlic, cooking until fragrant and lightly golden—about 1 minute.
Add the sliced mushrooms to the pan and sauté until they release their juices and turn golden brown, about 5-7 minutes.
Stir in the chopped spinach, cooking until wilted, about 2-3 minutes. Remove from heat and let the mixture cool slightly.
In a mixing bowl, combine the cooked pasta, sautéed vegetables, milk, half of the cheese, salt, and pepper. Mix until everything is evenly coated and combined.
Transfer the mixture into a greased baking dish, spreading it out evenly to create a uniform layer.
Sprinkle the remaining cheese generously over the top of the pasta, creating a thick, cheesy crust.
Bake in a preheated oven at 375°F (190°C) for about 20-25 minutes, or until bubbling and golden brown on top.
Remove from the oven and let it rest for 5 minutes, allowing the cheese to set slightly and making it easier to serve.
Scoop portions onto plates, and enjoy the bubbly, cheesy, and vegetable-packed baked pasta.