Not directly related to your question, but...just a thought -flies away-
Depending on your use case, counting might cost a lot. If you run a count query when a user logs off, the user has to wait until your server returns the data. Do users have to wait for something they're not going to use after they sign out? I think this is something that we might want to consider.
I think it's better to put those count queries into a queue to process them in the background. If eloquent can't help, then just run the raw query.
Ofcourse I'm processing this in the background to not let the user wait. Though I'm just wondering what the best way would be to use this in Laravel (and Eloquent as far as possible).
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community