Bläddra i källkod

Enforce HTTPS scheme in production environment

master
Amirul Anwar 14 timmar sedan
förälder
incheckning
7f40504941
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4
    1
      app/Providers/AppServiceProvider.php

+ 4
- 1
app/Providers/AppServiceProvider.php Visa fil

@@ -2,6 +2,7 @@
2 2
 
3 3
 namespace App\Providers;
4 4
 
5
+use Illuminate\Support\Facades\URL;
5 6
 use Illuminate\Support\ServiceProvider;
6 7
 
7 8
 class AppServiceProvider extends ServiceProvider
@@ -19,6 +20,8 @@ class AppServiceProvider extends ServiceProvider
19 20
      */
20 21
     public function boot(): void
21 22
     {
22
-        //
23
+        if (app()->environment('production')) {
24
+            URL::forceScheme('https');
25
+        }
23 26
     }
24 27
 }

Laddar…
Avbryt
Spara