【发布时间】:2018-04-28 01:15:13
【问题描述】:
我确实有两个 laravel 集合
$posts = collect($instagramService->fetchPosts('username'))->take(10);
还有一些帖子
$morePosts = collect($instagramService->fetchPosts('username'))->slice(10);
我正在刀片上显示第一个集合:
@foreach($posts as $post)
{{$post->url}}
{{$post->likes}}
@endforeach
<button type="submit">Show More</button>
我正在尝试研究 ajax 分页,但到目前为止还没有运气,所以如果有人可以在这里帮助我,将不胜感激。
问题:当我点击“显示更多”时,我想加载第二个集合?
【问题讨论】:
标签: php ajax laravel pagination