Have you tried something like this...
Hello Thank you for the reply. It didn't work with the link you provided me but it pointed me to the right direction. Here is my final code.
$url = URL::route('route_name', array('id'=>$id, '#hash_tag'));
Redirect::to($url)
Thank you.
A better way would be to append #hash
after URL::route(...)
so you won't get a question mark in the url.
With array:
$url = URL::route('welcome', ['#hash']);
return Redirect::to($url); // domain.com/welcome?#hash
Without (appended):
$url = URL::route('welcome') . '#hash';
return Redirect::to($url); // domain.com/welcome#hash
Marwelln said:
A better way would be to append
#hash
afterURL::route(...)
so you won't get a question mark in the url.With array:
$url = URL::route('welcome', ['#hash']); return Redirect::to($url); // domain.com/welcome?#hash
Without (appended):
$url = URL::route('welcome') . '#hash'; return Redirect::to($url); // domain.com/welcome#hash
This is definitely returns a clean result. But we need to write more code. Is there any way to use Redirect::route and get rid of the question mark?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community