Hey, i made a search view that searches data from the get method and tried to redirect the user back home if nothing is in the get method.
I used this
if(!isset($target)) {
Header('Location: '.URL::route('home'));
}
It did not work. I also used
if(!isset($target)) {
Redirect::to('/');
}
or
if(empty($target)) {
Redirect::to('/');
}
And it still does not work. If i do
if(empty($target)) {
echo "test";
}
test is echoed, but the redirect does not work. Why?
Try this instead. :)
return Redirect::to('/');
Add the return statement.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community