1

I want to know if there is a function where I can go back to my page after I submit a data.

For example, page 1, I submit my name, address and when I click next to page 2, it will show qualification, school. And after that if I want to go back to page 1 and change the value how do I do that? Such as Changing Name from John to John Doe when I go back to page 1.

I look around and saw something like return back, but does that help? Or should I use session?

Currently, I am just using redirects in my controller to bring the user to another page

Controller: (have something like that inside now)

    public function UserInfo(Request $request){
     $shirtSize = new user_info;
     //get input data and some other stuff
        $id->user_infos()->save($user_info);


    return redirect(url('/userAddInfo/'.$id->id.'/AddInfo'));
}
Dkna
  • 409
  • 3
  • 15
  • 37

1 Answers1

1

Use the url()->previous() method:

<a href="{{ url()->previous() }}">Back</a>

If you use redirects, you can use this solution to redirect two pages (requests) back.

Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279