user3818576 user3818576 - 3 months ago 33
PHP Question

header location not working in laravel 5.2

I don't know what's going in laravel. It doesn't work using the Header location in php.

$d = "http://www.google.com";
header('Location: '.$d);


and if I use Redirect::to() in my local, nothing happen. Is there something I need to setup first in laravel 5.2?

Answer

In Laravel 5.2. You should do like this

redirect()->to('url')->send();

Or

return redirect()->to('url');