jay stephens
jay stephens

Reputation: 65

Laravel - Passing form data to another page to continue form

I'm having trouble passing form data from one view to another, I don't want to validate the data and insert it into the database. I just need the data so I can insert it into a larger form.

I tried redirecting my post model with the variables from the first part of the form to the full form so I can display the data from the first form.

public function postQuote(Request $request)
{
    $fromDest = $request->input('from-dest');
    $toDest = $request->input('to-dest');


    return redirect('/quote')->with('fromDest', $fromDest)
        ->with('toDest', $fromDest);
}

But the variable doesn't pass. Is there any other method I can use to simply just pass the data onto another page?

I'm pretty new to Laravel, mostly used to the traditional ways of dealing with forms.

Upvotes: 0

Views: 2163

Answers (1)

ramzi trabelsi
ramzi trabelsi

Reputation: 852

You must store data in session to use it in the next request

See the docs Flash Data

i hope this will help you.

Upvotes: 1

Related Questions