How can I paginate a merged collection in Laravel 5?

后端 未结 7 1505
温柔的废话
温柔的废话 2020-12-02 14:31

I am creating a stream which contains two types of objects, BluePerson and RedPerson. To create the stream, I fetch all of both objects, then merge them into one collection.

相关标签:
7条回答
  • 2020-12-02 15:19

    Try following.

    $arr = $pets->toArray();
    $paginator->make($arr, count($arr), $perPage);
    
    0 讨论(0)
提交回复
热议问题