petritr's avatar
Level 15

How can i search inside each paginated page vue

How can i search inside each paginated page ? I use laravel pagination for pagination.

"current_page": 1, 
"data": [], 
"first_page_url": "app./api/logs?page=1", 
"from": 1, 
"last_page": 4, 
"last_page_url": "appl/api/logs?page=4", 
"next_page_url": "appl/api/logs?page=2", 
"path": "app/api/logs", 
"per_page": 10, 
"prev_page_url": null, 
"to": 10, 
"total": 31`` 

As i have it now the search will search only for the current page record. When im on "current_page": 1, the search will search only for the records in this page not all page data as i want.

When i search how can i search though all data not the only the current paginated page.

0 likes
4 replies
aurawindsurfing's avatar

Hi,

Create a separate variable that holds all of the records and pass it to vue. Search within this.

Happy coding!

petritr's avatar
Level 15

So i should make another endpoint where i load all records, idk if this is best practice ? What do you think @aurawindsurfing ?

aurawindsurfing's avatar

Well I'm not sure if this is best practice but it makes life easy ;-)

1 like

Please or to participate in this conversation.