How to specify columns we want from commentator with beyondcode/laravel-comments

I am using beyondcode/laravel-comments (https://github.com/beyondcode/laravel-comments) and I try to specify columns I want to get from commentator. here is the code:

$comment = $post->comments()->with('commentator', function ($query) {
$query->select('commentator.name', 'commentator.email');
//or $query->select('users.name', 'users.email');
})->latest();

I am getting error that said

Undefined table: 7 ERROR:  missing FROM-clause entry for table "commentator" // or users

How can I fix it? thanks



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/35q8M3l
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time