Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

timgavin's avatar

Pagination is over http instead of https

When paginating using {{ $posts->links() }}, Laravel is displaying the links as http:// instead of https://, even though I've specified https in the APP_URL inside .env, have set up URL::forceScheme('https'); in AppServiceProvider.php and am using SSL certs, not only from CloudFlare (using FULL), but have also installed a cert on the load balancer and am using LetsEncrypt on each server via Forge.

What could the issue be?

1 like
4 replies
timgavin's avatar

@realrandyallen As I mentioned in my post, I've already done that with URL::forceScheme('https'); :)

Edit: I take that back. The code you provided actually fixed it! Thanks! :)

1 like
iotstudent's avatar

what do you think causes this cos when i hosted on cpanel i did not have the issue but when i hiosted on an EC2 instance i had that issue too and your solution worked

Please or to participate in this conversation.