i have three tables users , posts and comment i want to get all posts and all comment for this posts when i use query builder join returned only posts that have a comment in comments table
enter code here $collection = DB::table('post')
->join('comment','post.id','comment.post_id')
->join('users','users.id','comment.commenter_id')
->orderBy('time', 'DESC')
->get()->all();
how can i return all posts or if you have another way to do it tell me pleas
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire