Hello !
I'm on Laravel 5.4 and I'm trying to make a multi-step form with AJAX. each step save the inputs in session and the last step save the records in database. To make that, I use different routes for each step :
Route::post('form/step-1', 'FormController@step1');
Route::post('form/step-2', 'FormController@step2');
Route::post('form/step-3', 'FormController@step3');
Route::post('form/step-4', 'FormController@step4');
Route::post('form/step-5', 'FormController@step5');
In my controller, I'm just doing this for each step :
public function step1 { RequestStep1Data $request) {
Session::put($request->all());
return response()->json();
}
When I move on the last step (step5), I'm loosing data session form previous step (not all, data from step 3 by exemple and no everytime) and I don't know why.....
Please, can you help me ?