How do I go back to the previous page in laravel?

How do I go back to the previous page in laravel?

8 Answers

  1. Use return redirect()->back(); in a Controller and use {{ url()->previous() }} in .blade.php View Files – Daniel Juric Mar 14 at 18:36.
  2. My element’s submit is using some post-method based route, if I use this in that route: Would this keep the form’s page visible or go back to some URL before the form? –

How do I redirect thank you page after submitting Contact Form 7?

To redirect users to the thank you page after form submission:

  1. Go to Contact >> Contact Form.
  2. Select the Redirect Settings tab.
  3. Choose the page where you want to redirect the users from the drop-down menu.
  4. Click Save.

How to redirect users to previous page after submitting a form?

I can redirect user after adding a node to any another page but would like to redirect them to previous page they were linked from. Now I use the following code: How can I change a code to redirect users to previous page after submitting the form? EDIT: Every foto node type has a node reference field “field_relate_to_gallery”.

How to return to the previous page after a submit form with PHP?

In your contact.php file, just use something like at the end of the PHP code: This will redirect back to whatever page you specify. You could do two things… 1) Have your php logic in the form file and submit to that file.

How to redirect back to previous page without refresh?

Here Mudassar Ahmed Khan has explained with an example, how to redirect (go) back to Previous Page without Refresh using JavaScript.

Are there any cons to redirecting to the same page?

Not sure of cons of this! While the question and answer is old, I think it’s lacking a few options. I have not find any cons with the methods, I would be happy to know if there are any? then if it next is there then it will redirect according to that other normal redirect .