timokfine's avatar

Go to last page of pagination?

I have a simple process where users submit posts to a thread. A controller stores the new post and redirects them back to the thread along with an anchor to the new post:

return redirect('thread/' . $thread->id . '#post-' . $post->id);
// http://domain.com/thread/23#post-45

Here's my problem...

Threads are currently paginated with 20 posts per page. When it redirects back to the thread, unless the new post is on the first page, the anchor obviously doesn't work and the user cannot see the post they just submitted.

Is there a way to always redirect to the LAST page in the threads pagination?

Thanks.

0 likes
3 replies
Anthonynzube's avatar

Mark the best answer to help others having similar issues

Please or to participate in this conversation.