robsontenorio/vue-api-query

Get total when using with pagination

Closed this issue · 2 comments

Hey!

Awesome library, using it in all projects now. One question:

So I'm using standard laravel pagination

this.games = await Game.page(this.page).$get()

and

$games=  Game::paginate(15);

And my API naturally returns the current page and a total number of pages. I need the total number of pages to build pagination on the frontend (again, naturally). I think I'm missing something obvious from the docs, but I didn't find it anywhere.

Hi @kurumbus! You just need to use the get without the $-prefix. It'll return all the response data :)

Oh yeah awesome!
The silly thing is I knew the difference between $get and get but didn't get that how to use it :-)