In my webshop i have searchgroups and searchtags.
Every searchtag belongs to a searchgroup.
The searchtags are connected to bikegroups with a many-to-many relation.
How i retrieve my groups with tags:
$searchgroups = SearchGroup::with('searchtags')->get();
Now i want to count how many times each searchtag exists in tags_bike_groups and display it.
So that i can display:
Year
2016 (2)
2017 (5)
2018 (0)
How do i achieve this?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire