Cheers02's avatar

Laravel 5.6 - Custom pagination link

this is my controller

$products = [ ... ];//this list of all my products in array

 $x= collect($products);
    $pageNum2 = \Illuminate\Pagination\Paginator::resolveCurrentPage('feedWooDetail2');
        $dbProduk = new \Illuminate\Pagination\LengthAwarePaginator(
            $x->forPage($pageNum2,12), 
            $x->count(),
            12, 
            $pageNum2, 
            ['path'=>url('myLink') . '/'.$idAkun,'pageName' => 'feedWooDetail2',]
        );

and in view i call {{$products ->links()}} and the results like this ‹1 2 3 4 5 6 7 8 ... 15 16›ant to change to this each side just show 3 like this <1 2 3 ...14 15 16>

0 likes
2 replies
shez1983's avatar

you might have to overwrite links() and then use it?

Please or to participate in this conversation.