CristalTeam / php-api-wrapper

:rainbow: Work with APIs like with Laravel Eloquent or Doctrine (no longer a dream)
MIT License
117 stars 32 forks source link

Can't get Laravel pagination to work #50

Open pandongo opened 1 year ago

pandongo commented 1 year ago

Hi

I am trying to handle simple pagination between my API and client. When looking at Cristal\ApiWrapper\Builder::class. the expected pagination contants seems to follow laravel standard. However, the page parameter is not passed to the API request.

What am I missing?

Client

$result = BookAPI::paginate(10);

Then in my view:

$result ->links()

API

$books= Book::paginate(10); return response()->json($books, 200);

First 10 results are showing as expected and the pagination is shown. When clicking to next page the URL parameter updates on the client view, but it is not passed to the API.