vendredi 13 novembre 2020

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

Aucun commentaire:

Enregistrer un commentaire