Yazar tarafından belirli bir gönderinin gönderdiği tüm yorumların üzerinden geçiyorum.
foreach($post->user->comments as $comment)
{
echo "<li>" . $comment->title . " (" . $comment->post->id . ")</li>";
}
Bu bana verir
I love this post (3)
This is a comment (5)
This is the second Comment (3)
Yukarıdaki listenin 3,3,5 olarak sıralanması için post_id ile nasıl sipariş veririm