movepixels's avatar

Laravel Pagination

Is there a way to not show the numbers 1 thru 10 and pass an option to only show 1-5?

1 thru 10 breaks on smaller screens so it would be nice to display

< << 1 - 5 >> >
0 likes
4 replies
movepixels's avatar

I am using API Resources so I cant figure out where to alter the $paginator

try {
      $invoices = $this->user->order()->whereIn('state', ['PAID', 'COMPLETED'])->newest()->paginate(25)->withQueryString();
    } catch (\Exception $e) {
      return $this->returnErrorResponse(10901);
    }
    return new PagesAccountInvoicesCollection($invoices);

The PagesAccountInvoicesCollection automatically wraps the paginations data so im lost as to where to I place my code to customize it?

Please or to participate in this conversation.