lundi 24 juillet 2017

Laravel 5: Show 5 category items with most counted products

I have two tables- categories and products. I would like to show only 5 categories with top product count, and sort by product count (most product counts on top) as below example:

  • Apple (100)
  • Orange (90)
  • Coconut (88)
  • Banana (69)
  • Mango (54)

Could you show me how to achieve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire