I have the same problem :) Try to dump Request::server() and find info about your connection
This example works for me:
if (Request::server('HTTP_X_FORWARDED_PROTO') == 'https')
{
echo "secure";
} else {
echo "unsecure";
}
I just had the same problem.
Are you behind a loadbalancer or something similar? We are using AWS Beanstalk with a LoadBalancer and the 443 is redirected to port 80. Request::secure() returns false even though the URI reads "https". Using a method similar to the above is what we ended up doing.
You might also look at : https://github.com/fideloper/TrustedProxy We still check the Request, but the proxy method helps.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.