dimanche 24 janvier 2016

Eloquent : find user with maximum pivot data (Alltime and of the month)

Still learning with Laravel, and I'm struggling with Eloquent.

I've got these two tables, users and contents. The foreign key contents.user_id is correctly set, and I wanted to query two things :

  • The user which has the maximum of contents (with the count)
  • The user which has the maximum content for the last 30 days (Also with the count).

I'd put an Eloquent query, but I can't find anything to start with.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1S4p5a6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire