Location headers in Laravel Location headers in Laravel laravel laravel

Location headers in Laravel


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

Sends HTTP headers and content. In my application, send() method acts like 'exit()' and is testable


I'm not sure I follow. Laravel sets the Location header as part of the Redirect::to() method. If you want to more explicitly define the response you could do it like this.

return Response::make( '', 302 )->header( 'Location', $url );

If that doesn't work I'd probably just fall back on the php stdlib header() and return null.

If all of this still doesn't do any good, maybe the profiler is messing things up. If it is turned on, try disabling it in the config.