L
L
Ler Den2018-06-22 17:21:16
Laravel
Ler Den, 2018-06-22 17:21:16

How to redirect to another page with options in Laravel?

There is a redirect defined in the routes.php file

Route::get( '/source', function() { return Redirect::to('/target', 302); }    );

Is it possible to save settings? for example, if the user requests '/source?param=value', then he will get a new page with this parameter '/target?param=value'.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
anlamas, 2018-06-22
@anlamas

// это неверно)
->with('param', $value)

upd:
redirect()->to('/target?' . $request->getQueryString());
redirect()->route('target' , ['param' => $value]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question