From 6a524b1373e493394221b74f31b2a9061e72aa91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ngh=C4=A9a=20Hu=E1=BB=B3nh=20L=C3=AA=20Nh=E1=BA=A5t?= Date: Tue, 26 Nov 2024 17:26:19 +0700 Subject: [PATCH] feat: Update boot method to force HTTPS in production environment - Added condition to check if the app is in production environment. - Applied \URL::forceScheme('https') to ensure all URLs are loaded over HTTPS. - Fixes issue of mixed content where static assets are loaded over HTTP while the page is served over HTTPS. --- app/Providers/AppServiceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ee8ca5bcd..2f29e9af6 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -23,6 +23,8 @@ public function register() */ public function boot() { - // + if (config('app.env') === 'production') { + \URL::forceScheme('https'); + } } }