From d5184a1b2fd726f2de3a699c3e323c5fc979c88c Mon Sep 17 00:00:00 2001 From: Mfalm3 Date: Mon, 29 Mar 2021 07:01:02 +0300 Subject: [PATCH] Enforce https in production environment --- routes/web.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routes/web.php b/routes/web.php index 3f00969..96dbb79 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,8 +3,10 @@ use App\Http\Controllers\PropertyController; use App\Http\Controllers\UsersController; use App\Http\Controllers\TenantController; +use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Route; use App\Models\House; +use Illuminate\Support\Facades\URL; /* |-------------------------------------------------------------------------- @@ -16,6 +18,10 @@ | contains the "web" middleware group. Now create something great! | */ +if (App::environment('production')) { + URL::forceScheme('https'); +} + Route::get('/', function () { return view('landing');