Closed LarryBarker closed 4 months ago
How can we show the count of tricks in the tag and topic lists? I tried returning Tag::withCount('tricks') in the TagList component. I am getting an error:
Tag::withCount('tricks')
TagList
Looks like the tricks relationship on the Tag model is delcared wrong. That should be a belongsToMany instead of hasMany.
tricks
belongsToMany
hasMany
How can we show the count of tricks in the tag and topic lists? I tried returning
Tag::withCount('tricks')
in theTagList
component. I am getting an error: