Laravel 5 Redirect::to with multiple parameters

V4n1ll4

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');
Joel Hinz

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Passing multiple parameters to controller in Laravel 5

From Dev

Laravel 5 - How to add multiple parameters to laravel array for db insert?

From Dev

Redirect loop when using multiple auth guards in Laravel 5

From Dev

Redirect loop when using multiple auth guards in Laravel 5

From Dev

Laravel 5 redirect with message

From Java

Laravel 5 - redirect to HTTPS

From Dev

Laravel 5 - redirect not working

From Dev

laravel 5 redirect loop

From Dev

Redirect Loop in Laravel 5

From Dev

Laravel - Redirect to route with optional parameters

From Dev

Redirect to named route with parameters in Laravel

From Dev

Laravel 4 - Redirect::route with parameters

From Dev

Redirect route with two parameters in WITH [Laravel]

From Dev

rspec redirect_to with multiple parameters

From Dev

how to pass multiple parameters in DELETE method in laravel 5?

From Dev

Pass multiple parameters to controller from route in laravel 5

From Dev

Routing with parameters in laravel 5

From Dev

Laravel 5 redirect loop error

From Dev

Redirect to route not working in Laravel 5

From Dev

Redirect after authentication in Laravel 5

From Dev

Redirect url with Variable in Laravel 5

From Dev

Laravel-5 Redirect Loop

From Dev

Multiple dynamic url redirect in Laravel

From Dev

laravel 4 Redirect to route with 2 parameters

From Dev

Redirect 301 url with multiple parameters to another url

From Dev

How to use redirect with multiple parameters in Django views?

From Dev

Laravel 5 route parameters not send

From Dev

Optional parameters in route - Laravel 5

From Dev

laravel bind multiple parameters in routeserviceprovider