Write the Eloquent expression that returns each category with its post count using withCount.
The admin dashboard needs a category list showing how many posts belong to each.
Ready to try it?
Create a free account and subscribe to take "Write a Query to Count Posts per Category". Earn 90 XP and track your internship progress.
Already have an account? Sign in