I'm trying to load only the last 3 comments on every post
问题 i want get all posts with last three comment on each post. my relation is public function comments() { return $this->hasMany('App\Commentpostfeed','post_id')->take(3); } This would return only 3 comments total whenever I called it instead of 3 comments per post. i use this way : 1 : Postfeed::with(['comment' => function($query) { $query->orderBy('created_at', 'desc')->take(3); }]); 2 : $postings = Postfeed::with('comments')->get(); but getting same result. please help me out for this problem.