I am trying this Query in Laravel 5.2
User::with(['posts'])
->withCount('post_images')
->orderBy('post_images_count', 'desc')
->take(8)
->get();
After that I got this error Call to undefined method Illuminate\Database\Query\Builder::post_images()
I did not understand what mistake is here.
Here users table
has relation with posts Table
and Posts table has relation with post_images table
Please guide How can I fix this.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qiyiEK
via IFTTT
Aucun commentaire:
Enregistrer un commentaire