Open hosseinnedaei opened 7 years ago
I have a product table and a related visits table that keep visit of products.
how can I create a new custom orderBy so when &order_by=visits_count,desc do this:
$products->withCount('visits')->orderBy('visits_count', 'desc');
and sort products by their visits.
I have a product table and a related visits table that keep visit of products.
how can I create a new custom orderBy so when &order_by=visits_count,desc do this:
$products->withCount('visits')->orderBy('visits_count', 'desc');
and sort products by their visits.