laravel limit relationship result

30

Album::with('images')->get()->map(function($album) {
    $album->setRelation('images', $album->images->take(3));
    return $album;
});

Comments

Submit
0 Comments