I dd(redirect()->intended()) and the default response is HTTP...
Using the 4th parameter of the function intended() I switch to secure and still redirected to HTTP.
I even changed to default value of the function.
FROM:
public function intended($status = 302, $headers = [], $secure = null)
{
$back = $this->generator->previous();
$path = $this->session->pull('url.intended', $back);
return $this->to($path, $status, $headers, $secure);
}
TO:
public function intended($status = 302, $headers = [], $secure = TRUE)
{
$back = $this->generator->previous();
$path = $this->session->pull('url.intended', $back);
return $this->to($path, $status, $headers, $secure);
}
And every time I dd() the intended URL is HTTP. I tried by using the secure() function but it requires a $path parameter.
So then I created a custom secure_intended() which response is HTTP as well.
public function secure_intended($status = 302, $headers = [])
{
$back = $this->generator->previous();
$path = $this->session->pull('url.intended', $back);
return $this->to($path, $status, $headers, true);
}
So is there another way around all this? Am I missing a function from Laravel I can use? Has someone encountered the same problem?