I'm working on a laravel vue project where i make a get request to a 3rd party API to get all orders of a company
The api has a limit of 100 orders per get request and they require you to use offset to get the next 100
Therefore i want to use pagination but this is new for me, so i'm not sure how to go about this
Currently i'm making a get request in my php Client class and I'm also building a pagination component in Vue
If i understand this correctly i somehow need to access the orders array returned from the Client inside the pagination component to say that if orders length equals 100 the offset in my client should now be 100 etc etc
Is this the way to do this? If so, is there any way to access the methods in php from inside a vue component? ( client to server side )
In that case, the only thing you can know is there are no additional pages if there are less than 100 records in the array for a given request. I don't know that your paginator will be particularly useful if you cannot provide the basic information about the length of the dataset, or the current page. The only option in that scenario is to keep an internal (to your server-side application) count of the current page (and therefore the offset for the previous and next requests assuming simple prev and next links).