Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

THOMABIGUERESEURL's avatar

Redirect with get parameters

Hi everyone,

I'm trying to make a redirection and add get parameters (I don't want to use Session::flash() for some reasons).

I'm not sure to understand how this can be done. When I try to do it like this :

Redirect::to('route')->with('step', 'dates') It adds the parameters into the session, but what I need is to redirect to the url :

/route?step=dates

Do you have any idea how this can be done ?

0 likes
5 replies
pmall's avatar
Redirect::to('route', ['step' => 'dates']);
1 like
THOMABIGUERESEURL's avatar

Hi,

Thanks for the quick answer, but when I do that I get an error : "The HTTP status code "1" is not valid."

Do you have any idea ? Thoma

pmall's avatar

Use a named route :

Route::get('route', ['as' => 'route.name', 'uses' => 'SomeController@SomeAction']);
redirect('route.name', ['step' => 'dates']);
1 like
mariordev's avatar

In Laravel 5.2 it should be

return redirect()->route('route.name', ['parameter' => 'value']);
1 like

Please or to participate in this conversation.