Support the ongoing development of Laravel.io →
Requests Input

Well, the title may sound a bit weird, but what I am trying to do can be simplified to: I am adding a comment I check, if the comment belongs to certain page by using the Route::current() When creating new, the form send the request to a controller with postAddComment method This method calls the Tutorial::addComment($comment) method In this method, I need to get a Route::current() of the PREVIOUS page (the page i submitted the comment from) Can somebody please understand (laugh) and help me? (Also, how the hell can i make a bulleted list here? I guess the Marksomething intepret here is broken as i can't use lists nor code block etc...)

Last updated 3 years ago.
0

Maybe this is what you are looking for: Redirect::back() ?

Last updated 3 years ago.
0

psychonetic said:

Maybe this is what you are looking for: Redirect::back() ?

Nope, I need to get the route to the previous page, to save the comment. Then i use the route to the page to load the appropriate comments...

Last updated 3 years ago.
0

Ok, I solved it by adding <input type="hidden" name="route" value="{{ Request::path(); }}"> to it..

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

JacobCZ jacobcz Joined 11 Aug 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.