Support the ongoing development of Laravel.io →
Database Eloquent Blade

Current I have a forum set up with some topics that people can reply to.

I can easily create replies and display them with the neat simplePaginate() method that Laravel provides, but I'm unable to find any easy way to create a comment, then immediately after creating it, go back to the topic they replied on while also referencing the particular page that the new comment would be on.

So, let's say I make a comment on a topic that has 8 pages of comments already there. After I reply, I would like to jump to my comment on the 8th page, but of course that number should be arbitrary because it could go to the 9th page as if it has reached its limit after adding the new comment.

Any suggestions?

Last updated 3 years ago.
0

It's called sessions. Example is another framework, but you should catch the drift.

<?php
$spage = Session::get('dogpage');
$spsch = Session::get('dogsearch');
$aval = Session::get('dogaval');
echo "<a href=".DIR."dog/indexadmin?p=".$spage."&psch=".$spsch."&aval=".$aval.">Back to List</a>";
?>

Normally you return to a list page after an edit, not an add.

Last updated 10 years ago.
0

Thanks, this helped me get me in the right direction.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

ayyobro ayyobro Joined 25 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.