W
W
WotanWeb2020-05-18 21:18:35
PHP
WotanWeb, 2020-05-18 21:18:35

Why doesn't eloquent pagination work?

Good day!
Tell me, maybe someone had experience connecting eloquent without Laravel?
How to make pagination work?
The method works, gives all the data you need, but does not give out anything except the first page at all, if you write /?page=2 in the line, etc.
What could be the problem?

Here in json
{"current_page": 1,
  "data": [
    {
      "id": 1,
      "first_name": "1"
    }
  ],
  "first_page_url": "/?page=1",
  "from": 1,
  "last_page": 3,
  "last_page_url": "/?page=3",
  "next_page_url": "/?page=2",
  "path": "/",
  "per_page": 1,
  "prev_page_url": null,
  "to": 1,
  "total": 3
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WotanWeb, 2020-05-19
@WotanWeb

(new User)->paginate($perPage, ['*'], 'page', $page)
On our host, it turned out to be a big problem to install illuminate/pagination, there was not enough memory, we had to mess around with it - put it on local and then endure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question