Apologies if this has been asked before but I feel I must be missing something straightforward in respect to pagination. I have an administration page with a paginated set of data which works a treat.
Each row has a link that goes off to an edit page - nothing very exciting here. The user returns back to the index page - either by cancel or saving changes etc. and I use the redirect->back() method to take me back to the index page - It seems to lose the 'current page' of the pagination and returns me to the start of the index list ie page 1.
What is the recommended routine for this? do I have to remember the page number for this particular page and set it in my controller when I want to show the index? or is there an elegant Laravel way?
You will have to pass it along in each request or save it somehow.. I guess the easiest and cleanest way would be to save the page number in session, then in your controller..
Check if URI parameter ?page=x exists
If not, then check if page number exists in session