← All tasks
🧮
Programming Advanced

Write a withCount Query With a Constraint

⏱ 3 min ⭐ 90 XP 🔁 3 attempts allowed

What you'll do

Write the Eloquent expression that counts only approved comments per post, using a constrained withCount.

Scenario

The dashboard should show approved comment counts, not total comments including pending/spam.

Ready to try it?

Create a free account and try "Write a withCount Query With a Constraint" free for 7 days, no card required. Earn 90 XP and track your internship progress.

Already have an account? Sign in