I need to pass multiple parameters to a redirect in Laravel 5. I tried the following but it gives me the error "The HTTP status code "1" is not valid."
return Redirect::to('availability', array('date' => urlencode(Session::get('bookingFormData.date')), 'expired' => 'true'));
My route is setup as follows:
Route::get('availability', 'BookingController@checkavailability');
The headers should be the third argument. The second is the HTTP status code. Hence, Laravel is complaining that the array you're passing isn't convertible into an HTTP status code.
Add a valid status code (e.g. 200 for "OK") as the second argument, and you should be fine. :)
Edit: On second thought, I don't think you're trying to send HTTP headers as the third argument either. You need to put those things in the session, e.g. something like this:
return redirect('availability')->with('yourParams', $yourArray);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments