Tuesday, March 7, 2017

How can i select table thread order by popular thread in laravel

i really confuse at eloquent that used for selecting popular thread when popular parameter was exist at difference table, so my table look like bellow:

-------------------
|    thread        |
-------------------
|id (int)          |
|title (varchar)   |
|value (text)      |
|timestamp         |
-------------------

 -------------------
|    comment       |
-------------------
|id (int)          |
|value (text)      |
|id_thread (id)    |
|timestamp         |
-------------------

so with above table, i wanna show all thread that order by most commented thread using eloquent laravel. i spend much time at this cases, but doesnt got sollution.



via Bill Tanthowi Jauhari

Advertisement