Skip to content

Commit a6fc588

Browse files
committed
Add force HTTPS flag into env
1 parent 7bf2d2e commit a6fc588

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
55
APP_URL=http://localhost:8000
6+
APP_FORCE_HTTPS=false
67

78
LOG_CHANNEL=daily
89
LOG_DEPRECATIONS_CHANNEL=null

app/Providers/AppServiceProvider.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
use App\Settings\GeneralSettings;
66
use Filament\Facades\Filament;
7-
use Filament\Navigation\UserMenuItem;
87
use Illuminate\Database\QueryException;
98
use Illuminate\Foundation\Vite;
109
use Illuminate\Support\Facades\Config;
11-
use Illuminate\Support\Facades\Schema;
10+
use Illuminate\Support\Facades\URL;
1211
use Illuminate\Support\HtmlString;
1312
use Illuminate\Support\ServiceProvider;
1413

@@ -69,6 +68,11 @@ public function boot()
6968
__('Security'),
7069
__('Settings'),
7170
]);
71+
72+
// Force HTTPS over HTTP
73+
if (env('APP_FORCE_HTTPS') ?? false) {
74+
URL::forceScheme('https');
75+
}
7276
}
7377

7478
private function configureApp(): void

0 commit comments

Comments
 (0)