3

skipandを使用したかったのtakeですが、ページネーションが機能しません。うまくいかないのはなぜですか?

コード:

    $posts = DB::table('posts')
        ->orderBy('id','desc')
        ->skip(9)
        ->take(3)
        ->paginate(3);



    if ($request->ajax()) {
        return ['posts' => view('blog.ajax.index')->with(compact('posts'))->render(),
            'next_page' => $posts->nextPageUrl()
        ];
    }

私は間違いなくページネーションを使用する必要があります

4

1 に答える 1