I have a url and I want make a redirection and I want to keep the url parameters.
I’m using the ->with method but it doesn’t work.
Example:
http://mywebsite.local/product-name-random?select_article=710
I want redirect this url to:
http://mywebsite.local/father-category-of-this-product?select_article=710
I’m using this code but it doesn’t work:
return redirect()->route('web.custom_url', $father_cathegory->seo->slug)->with('select_article', Input::get('select_article'));
->with() is not working. Nothing happens.
Im using Laravel 5.5.
3
Answers
You should try this way:
you can also use
it will redirect to route with input
Using
->with()
you’re flashing the session.You could do something like this: