After a user submits a form, we need to be able to take that information and pass it to another page. This recipe shows how we can use Laravel's built-in methods to handle our POST data.
Follow these steps to complete this recipe:
Create a route to handle the POST data from the form:
Route::post('userform', function() { // Process the data here return Redirect::to('userresults')- >withInput(Input::only('username', 'color')); });
Create a route to redirect to, and to display the data:
Route::get('userresults', function() { return 'Your username is: ' . Input::old('username') . '<br>Your favorite color is: ' . Input::old('color'); });