Support the ongoing development of Laravel.io →
Laravel Database
Last updated 2 years ago.
0

If you track the number of views and downloads by simply having a 'counter' in the database it's impossible to say which picture is the most popular this week/month.

I would recommend you to order the pictures by popularity. Pictures::where('status', 'active')->orderByDesc('views', 'downloads')->take(2)->get()

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Morish webfuelcode Joined 20 May 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.