UniqueHope's avatar

Can you use laravel's pagination, but change the results into an accordion?

The goal was to try and solve a problem of a query being too big by separating it into parts, and pagination does a lot of that on it's own already. Now if there is some table, instead of the ->links(), is there a way to put each 'page' of results into section of the accordion and then have the user clicking to open another section be kind of like opening a different page so not all the info gets pulled at once?

0 likes
4 replies
vincent15000's avatar

For me that's not more than pagination. When you click on another tab of the accordion, you load a new part of your results. The accordion's tabs will replace the back / next buttons of the pagination.

2 likes
jlrdw's avatar

so not all the info gets pulled at once

Pagination don't pull all at once.

2 likes
UniqueHope's avatar

Yea, that is why pagination was the go-to thought. The part I'm not entirely sure on, is how to move the relevant values from pagination around. (Or what's even there) Would there happen to be an example of a custom look somewhere I could reference?

jlrdw's avatar

@UniqueHope My suggestion is, I wouldn't put pagination in accordions. Just paginate.

1 like

Please or to participate in this conversation.