Laravel Multiple Pagination in one page

后端 未结 10 1739
独厮守ぢ
独厮守ぢ 2020-11-27 16:15

I\'m having some trouble with my pagination. I\'m having two tables with data from a database and I paginated it with laravel Paginator.

Now my problem is when you g

10条回答
  •  执念已碎
    2020-11-27 17:12

    in laravel 5.3 (maibe working in other laravel 5 version), i use like this:

        $produk = Produk::paginate(5, ['*'], 'produk');
        $region = Region::paginate(5, ['*'], 'region');
    

    and in blade templating append links currents of other to keep the position:

        {{$produk->appends(['region' => $region->currentPage()])->links()}}    
        {{$region->appends(['produk' => $produk->currentPage()])->links()}}    
    

提交回复
热议问题