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()
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community