V
V
voilqrZ2019-12-03 08:43:51
Laravel
voilqrZ, 2019-12-03 08:43:51

Get parent in Eager Loading in Laravel?

Let's load posts with comments and their votes

$posts = App\Post::with(['comments.votes' => function($query) {
  // Как здесь получить комментарий, к которому принадлежит голос?
}])->get();

How can I get comments votes?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question