Explorar el Código

Enforce HTTPS scheme in production environment

master
Amirul Anwar hace 14 horas
padre
commit
7f40504941
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4
    1
      app/Providers/AppServiceProvider.php

+ 4
- 1
app/Providers/AppServiceProvider.php Ver fichero

@@ -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
 }

Loading…
Cancelar
Guardar