Laravel LengthAwarePaginator returned data are not in single obejct

Thảo luận trong 'PHP/MySQL' bắt đầu bởi Auto RSS, 5/4/18.

  1. Auto RSS Ngân Hàng Câu Hỏi ?

    Below is my code on how I did my custom paginator and the console log.
    PHP:
    $data collect($playerMatchArr);
    $result = new LengthAwarePaginator(
        
    $data->forPage($page3),
        
    $data->count(),
        
    $limit,
        
    $page
    );
    it returns the correct data and format during first request, but the 2nd request and others are not formatted same way as the first one.
    [​IMG]
     
     
  2. Bình Luận Bằng Facebook

  3. TechBuba

    TechBuba Nhà Báo (Báo Đời) Thành viên BQT

    Below is my code on how I did my custom paginator.
    PHP:
    $data collect($playerMatchArr);
    $result = new LengthAwarePaginator(
        
    array_values($data->forPage($page3)->all()),
        
    $data->count(),
        
    $limit,
        
    $page
    );