Location headers in Laravel

header, laravel, location, php, redirect

Solution

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

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

Problem

I'm working with a Library for my university's authentication system (Ucam_Webauth) which means I have to redirect to the authentication server in one of the methods. Unfortunately, I cannot return a `Redirect:to()` because of the architecture of this library. The library itself uses `header('Location: ...');` but this isn't working for some reason. If I make the programme `die();` after sending the header it works, but otherwise it doesn't. Any idea how I can fix this?

Original source